From 023d4ee45ee98e4ae0acd3fe3754b1a6a0c905f1 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 31 Dec 2025 10:01:47 +0000 Subject: [PATCH] fix(aws-devcontainer): add availability zone selection parameter This change resolves the TODO on line 157 by adding a new coder_parameter that allows users to select which AWS availability zone (a, b, c, or d) their workspace should be deployed in, rather than always defaulting to zone 'a'. The parameter is set as non-mutable and defaults to 'a' to maintain backward compatibility with existing workspaces. --- .../coder/templates/aws-devcontainer/main.tf | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/registry/coder/templates/aws-devcontainer/main.tf b/registry/coder/templates/aws-devcontainer/main.tf index 6d42ff25..e2bb5b02 100644 --- a/registry/coder/templates/aws-devcontainer/main.tf +++ b/registry/coder/templates/aws-devcontainer/main.tf @@ -142,6 +142,30 @@ data "coder_parameter" "ssh_pubkey" { mutable = false } +data "coder_parameter" "availability_zone_suffix" { + name = "availability_zone_suffix" + display_name = "Availability Zone" + description = "Which availability zone should your workspace be deployed in?" + default = "a" + mutable = false + option { + name = "Zone A" + value = "a" + } + option { + name = "Zone B" + value = "b" + } + option { + name = "Zone C" + value = "c" + } + option { + name = "Zone D" + value = "d" + } +} + data "local_sensitive_file" "cache_repo_dockerconfigjson" { count = var.cache_repo_docker_config_path == "" ? 0 : 1 filename = var.cache_repo_docker_config_path @@ -154,8 +178,7 @@ data "aws_iam_instance_profile" "vm_instance_profile" { # Be careful when modifying the below locals! locals { - # TODO: provide a way to pick the availability zone. - aws_availability_zone = "${module.aws_region.value}a" + aws_availability_zone = "${module.aws_region.value}${data.coder_parameter.availability_zone_suffix.value}" hostname = lower(data.coder_workspace.me.name) linux_user = "coder"