diff --git a/registry/coder-labs/templates/tasks-docker/main.tf b/registry/coder-labs/templates/tasks-docker/main.tf index 35a64540..4d3c7136 100644 --- a/registry/coder-labs/templates/tasks-docker/main.tf +++ b/registry/coder-labs/templates/tasks-docker/main.tf @@ -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" @@ -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 @@ -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" {} @@ -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 -} - -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" - + 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" - order = 2 +} + +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" + folder = "/home/coder/projects" } resource "docker_volume" "home_volume" { @@ -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" @@ -422,4 +422,4 @@ resource "docker_container" "workspace" { label = "coder.workspace_name" value = data.coder_workspace.me.name } -} +} \ No newline at end of file diff --git a/registry/coder/templates/aws-devcontainer/main.tf b/registry/coder/templates/aws-devcontainer/main.tf index b23b9a65..6d42ff25 100644 --- a/registry/coder/templates/aws-devcontainer/main.tf +++ b/registry/coder/templates/aws-devcontainer/main.tf @@ -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" } diff --git a/registry/coder/templates/aws-linux/main.tf b/registry/coder/templates/aws-linux/main.tf index bf59dadc..407a4a44 100644 --- a/registry/coder/templates/aws-linux/main.tf +++ b/registry/coder/templates/aws-linux/main.tf @@ -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 -} - -# 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" - agent_id = coder_agent.dev[0].id agent_name = "dev" - order = 2 + order = 1 +} + +# 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" + folder = "/home/coder" } locals { @@ -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" -} +} \ No newline at end of file diff --git a/registry/coder/templates/azure-linux/main.tf b/registry/coder/templates/azure-linux/main.tf index 687c8cae..bfe6d21b 100644 --- a/registry/coder/templates/azure-linux/main.tf +++ b/registry/coder/templates/azure-linux/main.tf @@ -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 -} - -# 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" - agent_id = coder_agent.main.id agent_name = "main" - order = 2 + order = 1 +} + +# 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" + folder = "/home/coder" } locals { @@ -322,4 +313,4 @@ resource "coder_metadata" "home_info" { key = "size" value = "${data.coder_parameter.home_size.value} GiB" } -} +} \ No newline at end of file diff --git a/registry/coder/templates/azure-windows/main.tf b/registry/coder/templates/azure-windows/main.tf index 65447a77..b7623be5 100644 --- a/registry/coder/templates/azure-windows/main.tf +++ b/registry/coder/templates/azure-windows/main.tf @@ -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 } diff --git a/registry/coder/templates/digitalocean-linux/main.tf b/registry/coder/templates/digitalocean-linux/main.tf index 4daf4b8b..4bca6c2f 100644 --- a/registry/coder/templates/digitalocean-linux/main.tf +++ b/registry/coder/templates/digitalocean-linux/main.tf @@ -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 -} - -# 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" - agent_id = coder_agent.main.id agent_name = "main" - order = 2 + order = 1 +} + +# 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" + folder = "/home/coder" } resource "digitalocean_volume" "home_volume" { @@ -358,4 +349,4 @@ resource "coder_metadata" "volume-info" { key = "size" value = "${digitalocean_volume.home_volume.size} GiB" } -} +} \ No newline at end of file diff --git a/registry/coder/templates/docker-devcontainer/main.tf b/registry/coder/templates/docker-devcontainer/main.tf index 2765874f..bb932cfd 100644 --- a/registry/coder/templates/docker-devcontainer/main.tf +++ b/registry/coder/templates/docker-devcontainer/main.tf @@ -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 -} - -# 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" - agent_id = coder_agent.main.id agent_name = "main" - order = 2 + order = 1 +} + +# 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" + folder = "/workspaces" } resource "coder_metadata" "container_info" { @@ -369,4 +360,4 @@ resource "coder_metadata" "container_info" { key = "cache repo" value = var.cache_repo == "" ? "not enabled" : var.cache_repo } -} +} \ No newline at end of file diff --git a/registry/coder/templates/docker/main.tf b/registry/coder/templates/docker/main.tf index 234c4338..b7d0ef15 100644 --- a/registry/coder/templates/docker/main.tf +++ b/registry/coder/templates/docker/main.tf @@ -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 -} - -# 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" - agent_id = coder_agent.main.id agent_name = "main" - order = 2 + order = 1 +} + +# 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" + folder = "/home/coder" } resource "docker_volume" "home_volume" { @@ -217,4 +208,4 @@ resource "docker_container" "workspace" { label = "coder.workspace_name" value = data.coder_workspace.me.name } -} +} \ No newline at end of file diff --git a/registry/coder/templates/gcp-devcontainer/main.tf b/registry/coder/templates/gcp-devcontainer/main.tf index 317a22fc..87fa8b7a 100644 --- a/registry/coder/templates/gcp-devcontainer/main.tf +++ b/registry/coder/templates/gcp-devcontainer/main.tf @@ -291,28 +291,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 -} - -# 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 = "/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" - agent_id = coder_agent.main.id agent_name = "main" - order = 2 + order = 1 +} + +# 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" + folder = "/workspaces" } # Create metadata for the workspace and home disk. @@ -338,4 +329,4 @@ resource "coder_metadata" "home_info" { key = "size" value = "${google_compute_disk.root.size} GiB" } -} +} \ No newline at end of file diff --git a/registry/coder/templates/gcp-linux/main.tf b/registry/coder/templates/gcp-linux/main.tf index 286db4e4..60fb3447 100644 --- a/registry/coder/templates/gcp-linux/main.tf +++ b/registry/coder/templates/gcp-linux/main.tf @@ -99,28 +99,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 -} - -# 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" - agent_id = coder_agent.main.id agent_name = "main" - order = 2 + order = 1 +} + +# 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" + folder = "/home/coder" } resource "google_compute_instance" "dev" { @@ -181,4 +172,4 @@ resource "coder_metadata" "home_info" { key = "size" value = "${google_compute_disk.root.size} GiB" } -} +} \ No newline at end of file diff --git a/registry/coder/templates/gcp-vm-container/main.tf b/registry/coder/templates/gcp-vm-container/main.tf index b259b4b2..b5a7aa23 100644 --- a/registry/coder/templates/gcp-vm-container/main.tf +++ b/registry/coder/templates/gcp-vm-container/main.tf @@ -52,28 +52,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 -} - -# 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" - agent_id = coder_agent.main.id agent_name = "main" - order = 2 + order = 1 +} + +# 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" + folder = "/home/coder" } # See https://registry.terraform.io/modules/terraform-google-modules/container-vm @@ -122,6 +113,7 @@ resource "google_compute_instance" "dev" { resource "coder_agent_instance" "dev" { count = data.coder_workspace.me.start_count agent_id = coder_agent.main.id + agent_name = "main" instance_id = google_compute_instance.dev[0].instance_id } @@ -133,4 +125,4 @@ resource "coder_metadata" "workspace_info" { key = "image" value = module.gce-container.container.image } -} +} \ No newline at end of file diff --git a/registry/coder/templates/kubernetes-devcontainer/main.tf b/registry/coder/templates/kubernetes-devcontainer/main.tf index 8fc79fa2..85d2e0c5 100644 --- a/registry/coder/templates/kubernetes-devcontainer/main.tf +++ b/registry/coder/templates/kubernetes-devcontainer/main.tf @@ -422,28 +422,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 -} - -# 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" - agent_id = coder_agent.main.id agent_name = "main" - order = 2 + order = 1 +} + +# 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" + folder = "/home/coder" } resource "coder_metadata" "container_info" { @@ -461,4 +452,4 @@ resource "coder_metadata" "container_info" { key = "cache repo" value = var.cache_repo == "" ? "not enabled" : var.cache_repo } -} +} \ No newline at end of file diff --git a/registry/coder/templates/kubernetes-envbox/main.tf b/registry/coder/templates/kubernetes-envbox/main.tf index 00ae9a2f..e70ad2a3 100644 --- a/registry/coder/templates/kubernetes-envbox/main.tf +++ b/registry/coder/templates/kubernetes-envbox/main.tf @@ -106,28 +106,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 -} - -# 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" - agent_id = coder_agent.main.id agent_name = "main" - order = 2 + order = 1 +} + +# 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" + folder = "/home/coder" } resource "kubernetes_persistent_volume_claim" "home" { @@ -319,4 +310,4 @@ resource "kubernetes_pod" "main" { } } } -} +} \ No newline at end of file diff --git a/registry/coder/templates/kubernetes/main.tf b/registry/coder/templates/kubernetes/main.tf index e1fdb12c..c72316ff 100644 --- a/registry/coder/templates/kubernetes/main.tf +++ b/registry/coder/templates/kubernetes/main.tf @@ -177,6 +177,7 @@ resource "coder_agent" "main" { # code-server resource "coder_app" "code-server" { agent_id = coder_agent.main.id + agent_name = "main" slug = "code-server" display_name = "code-server" icon = "/icon/code.svg" diff --git a/registry/coder/templates/nomad-docker/main.tf b/registry/coder/templates/nomad-docker/main.tf index 9fc50893..9c30b7be 100644 --- a/registry/coder/templates/nomad-docker/main.tf +++ b/registry/coder/templates/nomad-docker/main.tf @@ -118,8 +118,9 @@ 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 } locals { diff --git a/registry/coder/templates/scratch/main.tf b/registry/coder/templates/scratch/main.tf index 4f565472..f55ee0c3 100644 --- a/registry/coder/templates/scratch/main.tf +++ b/registry/coder/templates/scratch/main.tf @@ -34,9 +34,10 @@ resource "coder_agent" "main" { # Use this to set environment variables in your workspace # details: https://registry.terraform.io/providers/coder/coder/latest/docs/resources/env resource "coder_env" "welcome_message" { - agent_id = coder_agent.main.id - name = "WELCOME_MESSAGE" - value = "Welcome to your Coder workspace!" + agent_id = coder_agent.main.id + agent_name = "main" + name = "WELCOME_MESSAGE" + value = "Welcome to your Coder workspace!" } # Adds code-server @@ -48,13 +49,15 @@ 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 + agent_id = coder_agent.main.id + agent_name = "main" } # Runs a script at workspace start/stop or on a cron schedule # details: https://registry.terraform.io/providers/coder/coder/latest/docs/resources/script resource "coder_script" "startup_script" { agent_id = coder_agent.main.id + agent_name = "main" display_name = "Startup Script" script = <<-EOF #!/bin/sh