Skip to content
84 changes: 42 additions & 42 deletions registry/coder-labs/templates/tasks-docker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module "claude-code" {
source = "registry.coder.com/coder/claude-code/coder"
version = "2.0.0"
agent_id = coder_agent.main.id
agent_name = "main"
folder = "/home/coder/projects"
install_claude_code = true
claude_code_version = "latest"
Expand All @@ -44,9 +45,10 @@ variable "anthropic_api_key" {
sensitive = true
}
resource "coder_env" "anthropic_api_key" {
agent_id = coder_agent.main.id
name = "CODER_MCP_CLAUDE_API_KEY"
value = var.anthropic_api_key
agent_id = coder_agent.main.id
agent_name = "main"
name = "CODER_MCP_CLAUDE_API_KEY"
value = var.anthropic_api_key
}

# We are using presets to set the prompts, image, and set up instructions
Expand Down Expand Up @@ -174,19 +176,22 @@ data "coder_parameter" "preview_port" {

# Other variables for Claude Code
resource "coder_env" "claude_task_prompt" {
agent_id = coder_agent.main.id
name = "CODER_MCP_CLAUDE_TASK_PROMPT"
value = data.coder_parameter.ai_prompt.value
agent_id = coder_agent.main.id
agent_name = "main"
name = "CODER_MCP_CLAUDE_TASK_PROMPT"
value = data.coder_parameter.ai_prompt.value
}
resource "coder_env" "app_status_slug" {
agent_id = coder_agent.main.id
name = "CODER_MCP_APP_STATUS_SLUG"
value = "ccw"
agent_id = coder_agent.main.id
agent_name = "main"
name = "CODER_MCP_APP_STATUS_SLUG"
value = "ccw"
}
resource "coder_env" "claude_system_prompt" {
agent_id = coder_agent.main.id
name = "CODER_MCP_CLAUDE_SYSTEM_PROMPT"
value = data.coder_parameter.system_prompt.value
agent_id = coder_agent.main.id
agent_name = "main"
name = "CODER_MCP_CLAUDE_SYSTEM_PROMPT"
value = data.coder_parameter.system_prompt.value
}

data "coder_provisioner" "me" {}
Expand Down Expand Up @@ -296,48 +301,42 @@ module "code-server" {
# 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.
version = "~> 1.0"

agent_id = coder_agent.main.id
order = 1
agent_id = coder_agent.main.id
agent_name = "main"
order = 1
}

module "vscode" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/vscode-desktop/coder"
version = "1.1.0"
agent_id = coder_agent.main.id
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/vscode-desktop/coder"
version = "1.1.0"
agent_id = coder_agent.main.id
agent_name = "main"
}

module "windsurf" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/windsurf/coder"
version = "1.1.0"
agent_id = coder_agent.main.id
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/windsurf/coder"
version = "1.1.0"
agent_id = coder_agent.main.id
agent_name = "main"
}

module "cursor" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/cursor/coder"
version = "1.2.0"
agent_id = coder_agent.main.id
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/cursor/coder"
version = "1.2.0"
agent_id = coder_agent.main.id
agent_name = "main"
}

module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains-gateway/coder"

# JetBrains IDEs to make available for the user to select
jetbrains_ides = ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD", "RR"]
default = "IU"

# Default folder to open when starting a JetBrains IDE
folder = "/home/coder/projects"

# 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.
version = "~> 1.0"

module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/coder/jetbrains/coder"
version = "~> 1.0"
agent_id = coder_agent.main.id
agent_name = "main"
order = 2
folder = "/home/coder/projects"
}

resource "docker_volume" "home_volume" {
Expand Down Expand Up @@ -369,6 +368,7 @@ resource "docker_volume" "home_volume" {

resource "coder_app" "preview" {
agent_id = coder_agent.main.id
agent_name = "main"
slug = "preview"
display_name = "Preview your app"
icon = "${data.coder_workspace.me.access_url}/emojis/1f50e.png"
Expand Down Expand Up @@ -422,4 +422,4 @@ resource "docker_container" "workspace" {
label = "coder.workspace_name"
value = data.coder_workspace.me.name
}
}
}
5 changes: 3 additions & 2 deletions registry/coder/templates/aws-devcontainer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ module "code-server" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/code-server/coder"
# 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.
version = "~> 1.0"
agent_id = coder_agent.dev[0].id
version = "~> 1.0"
agent_id = coder_agent.dev[0].id
agent_name = "dev"
}
29 changes: 10 additions & 19 deletions registry/coder/templates/aws-linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -201,28 +201,19 @@ module "code-server" {
# 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.
version = "~> 1.0"

agent_id = coder_agent.dev[0].id
order = 1
agent_id = coder_agent.dev[0].id
agent_name = "dev"
order = 1
}

# See https://registry.coder.com/modules/jetbrains-gateway
module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/jetbrains-gateway/coder"

# JetBrains IDEs to make available for the user to select
jetbrains_ides = ["IU", "PY", "WS", "PS", "RD", "CL", "GO", "RM"]
default = "IU"

# Default folder to open when starting a JetBrains IDE
folder = "/home/coder"

# 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.
version = "~> 1.0"

# See https://registry.coder.com/modules/coder/jetbrains
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/coder/jetbrains/coder"
version = "~> 1.0"
agent_id = coder_agent.dev[0].id
agent_name = "dev"
order = 2
folder = "/home/coder"
}

locals {
Expand Down Expand Up @@ -293,4 +284,4 @@ resource "coder_metadata" "workspace_info" {
resource "aws_ec2_instance_state" "dev" {
instance_id = aws_instance.dev.id
state = data.coder_workspace.me.transition == "start" ? "running" : "stopped"
}
}
29 changes: 10 additions & 19 deletions registry/coder/templates/azure-linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,19 @@ module "code-server" {
# 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.
version = "~> 1.0"

agent_id = coder_agent.main.id
order = 1
agent_id = coder_agent.main.id
agent_name = "main"
order = 1
}

# See https://registry.coder.com/modules/coder/jetbrains-gateway
module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains-gateway/coder"

# JetBrains IDEs to make available for the user to select
jetbrains_ides = ["IU", "PY", "WS", "PS", "RD", "CL", "GO", "RM"]
default = "IU"

# Default folder to open when starting a JetBrains IDE
folder = "/home/coder"

# 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.
version = "~> 1.0"

# See https://registry.coder.com/modules/coder/jetbrains
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/coder/jetbrains/coder"
version = "~> 1.0"
agent_id = coder_agent.main.id
agent_name = "main"
order = 2
folder = "/home/coder"
}

locals {
Expand Down Expand Up @@ -322,4 +313,4 @@ resource "coder_metadata" "home_info" {
key = "size"
value = "${data.coder_parameter.home_size.value} GiB"
}
}
}
1 change: 1 addition & 0 deletions registry/coder/templates/azure-windows/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module "windows_rdp" {
admin_password = random_password.admin_password.result

agent_id = resource.coder_agent.main.id
agent_name = "main"
resource_id = null # Unused, to be removed in a future version
}

Expand Down
29 changes: 10 additions & 19 deletions registry/coder/templates/digitalocean-linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -272,28 +272,19 @@ module "code-server" {
# 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.
version = "~> 1.0"

agent_id = coder_agent.main.id
order = 1
agent_id = coder_agent.main.id
agent_name = "main"
order = 1
}

# See https://registry.coder.com/modules/coder/jetbrains-gateway
module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains-gateway/coder"

# JetBrains IDEs to make available for the user to select
jetbrains_ides = ["IU", "PY", "WS", "PS", "RD", "CL", "GO", "RM"]
default = "IU"

# Default folder to open when starting a JetBrains IDE
folder = "/home/coder"

# 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.
version = "~> 1.0"

# See https://registry.coder.com/modules/coder/jetbrains
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/coder/jetbrains/coder"
version = "~> 1.0"
agent_id = coder_agent.main.id
agent_name = "main"
order = 2
folder = "/home/coder"
}

resource "digitalocean_volume" "home_volume" {
Expand Down Expand Up @@ -358,4 +349,4 @@ resource "coder_metadata" "volume-info" {
key = "size"
value = "${digitalocean_volume.home_volume.size} GiB"
}
}
}
29 changes: 10 additions & 19 deletions registry/coder/templates/docker-devcontainer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -330,28 +330,19 @@ module "code-server" {
# 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.
version = "~> 1.0"

agent_id = coder_agent.main.id
order = 1
agent_id = coder_agent.main.id
agent_name = "main"
order = 1
}

# See https://registry.coder.com/modules/coder/jetbrains-gateway
module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains-gateway/coder"

# JetBrains IDEs to make available for the user to select
jetbrains_ides = ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD", "RR"]
default = "IU"

# Default folder to open when starting a JetBrains IDE
folder = "/workspaces"

# 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.
version = "~> 1.0"

# See https://registry.coder.com/modules/coder/jetbrains
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/coder/jetbrains/coder"
version = "~> 1.0"
agent_id = coder_agent.main.id
agent_name = "main"
order = 2
folder = "/workspaces"
}

resource "coder_metadata" "container_info" {
Expand All @@ -369,4 +360,4 @@ resource "coder_metadata" "container_info" {
key = "cache repo"
value = var.cache_repo == "" ? "not enabled" : var.cache_repo
}
}
}
29 changes: 10 additions & 19 deletions registry/coder/templates/docker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,28 +129,19 @@ module "code-server" {
# 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.
version = "~> 1.0"

agent_id = coder_agent.main.id
order = 1
agent_id = coder_agent.main.id
agent_name = "main"
order = 1
}

# See https://registry.coder.com/modules/coder/jetbrains-gateway
module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains-gateway/coder"

# JetBrains IDEs to make available for the user to select
jetbrains_ides = ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD", "RR"]
default = "IU"

# Default folder to open when starting a JetBrains IDE
folder = "/home/coder"

# 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.
version = "~> 1.0"

# See https://registry.coder.com/modules/coder/jetbrains
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/coder/jetbrains/coder"
version = "~> 1.0"
agent_id = coder_agent.main.id
agent_name = "main"
order = 2
folder = "/home/coder"
}

resource "docker_volume" "home_volume" {
Expand Down Expand Up @@ -217,4 +208,4 @@ resource "docker_container" "workspace" {
label = "coder.workspace_name"
value = data.coder_workspace.me.name
}
}
}
Loading