Skip to content

Commit 6223569

Browse files
committed
feat: add template for externally managed workspaces to coder-labs
1 parent f5a5716 commit 6223569

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

.icons/paperclip-emoji.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
display_name: Externally Managed Workspace
3+
description: A template for externally managed workspaces
4+
icon: ../../../../.icons/paperclip-emoji.svg
5+
verified: true
6+
tags: [external]
7+
---
8+
9+
# Externally Managed Workspace Template
10+
11+
This template provides a minimal scaffolding for creating Coder workspaces that connect to externally provisioned compute resources.
12+
13+
Use this template as a starting point to build your own custom templates for scenarios where you need to connect to existing infrastructure.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
terraform {
2+
required_providers {
3+
coder = {
4+
source = "coder/coder"
5+
}
6+
}
7+
}
8+
9+
data "coder_workspace" "me" {}
10+
11+
resource "coder_agent" "main" {
12+
arch = "amd64"
13+
os = "linux"
14+
}
15+
16+
resource "coder_external_agent" "main" {
17+
agent_id = coder_agent.main.id
18+
}
19+
20+
# Adds code-server
21+
# See all available modules at https://registry.coder.com/modules
22+
module "code-server" {
23+
count = data.coder_workspace.me.start_count
24+
source = "registry.coder.com/coder/code-server/coder"
25+
26+
# This ensures that the latest non-breaking version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
27+
version = "~> 1.0"
28+
29+
agent_id = coder_agent.main.id
30+
}

0 commit comments

Comments
 (0)