feat: template builder backend fixes (DEVEX-287) (#26432)

Part of the Template Builder wizard PR stack.

## Backend fixes

1. **Registry URL scheme fix**: Default
`CODER_TEMPLATE_BUILDER_REGISTRY_URL` was `https://registry.coder.com`
but Terraform module registry addresses must be scheme-less. Changed to
`registry.coder.com`.

2. **Sensitive variable defaults**: Module `.tf.tmpl` files for
claude-code, aider, amazon-q had sensitive `variable` blocks without
`default`, causing `terraform plan` to fail during template import. Also
fixed the `templatebuildermodulegen` script.

3. **Auto-quote string variables**: The backend now accepts raw string
values from callers and wraps them in HCL quotes automatically.
Previously callers were required to send pre-quoted HCL literals, which
is not a reasonable API contract.

---
> [!NOTE]
> Generated by Coder Agents on behalf of @jeremyruppel
This commit is contained in:
Jeremy Ruppel
2026-06-23 09:17:14 -04:00
committed by GitHub
parent eeb2624549
commit a30631198d
12 changed files with 73 additions and 68 deletions
+1 -1
View File
@@ -911,7 +911,7 @@ TEMPLATE BUILDER OPTIONS:
Disable the template builder feature for guided template creation.
When disabled, all /api/v2/templatebuilder/* endpoints return 404.
--template-builder-registry-url string, $CODER_TEMPLATE_BUILDER_REGISTRY_URL (default: https://registry.coder.com)
--template-builder-registry-url string, $CODER_TEMPLATE_BUILDER_REGISTRY_URL (default: registry.coder.com)
The base URL of the module registry used by the template builder for
module source paths.
+2 -2
View File
@@ -1145,5 +1145,5 @@ templateBuilder:
disabled: false
# The base URL of the module registry used by the template builder for module
# source paths.
# (default: https://registry.coder.com, type: string)
registryURL: https://registry.coder.com
# (default: registry.coder.com, type: string)
registryURL: registry.coder.com