fix(templates): fix terraform errors#951
Merged
Merged
Conversation
Running 'terraform validate' on every template (now enforced by scripts/terraform_validate.sh) surfaced pre-existing breakages in 14 coder/* templates. Fixes: - Remove unsupported 'agent_name' argument from code-server / windows_rdp module calls and from coder_app / coder_env / coder_script / coder_agent_instance resources (agent_name is only valid on the jetbrains/filebrowser modules, which are left untouched). - Correct the jetbrains module source from the invalid 5-component 'registry.coder.com/modules/coder/jetbrains/coder' to 'registry.coder.com/coder/jetbrains/coder'. - Remove the stray 'resource_id = null' argument from windows_rdp. - aws-devcontainer: use the proper registry source + version for the aws-region module instead of a raw https URL. - gcp-devcontainer: reference the actual agent (coder_agent.dev[0]) instead of the non-existent coder_agent.main. - incus: update to the lxc/incus provider schema — incus_volume -> incus_storage_volume, incus_cached_image -> incus_image (object source_image), drop the unsupported incus_instance_file resource (deliver the agent token via cloud-init write_files), and move instance limits into config (limits.cpu/limits.memory). All 14 templates now pass 'terraform validate'.
DevelopmentCats
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Now that
scripts/terraform_validate.shvalidates templates (from #948), runningterraform validateacross the registry surfaces pre-existing breakages in 14coder/*templates. This PR fixes all of them so they pass validation.Fixes
Unsupported
agent_nameargument (dominant issue)agent_namefromcode-server/windows_rdpmodule calls and fromcoder_app/coder_env/coder_script/coder_agent_instanceresources. Only thejetbrainsandfilebrowsermodules actually declare anagent_namevariable, so those usages are left intact.Invalid
jetbrainsmodule sourceregistry.coder.com/modules/coder/jetbrains/coder(5 components — invalid) →registry.coder.com/coder/jetbrains/coder.windows_rdp stray argument
resource_id = null(no longer a supported argument).aws-devcontainer region module
source = "https://registry.coder.com/modules/aws-region"URL with the proper registry sourceregistry.coder.com/coder/aws-region/coder+version = "~> 1.0".gcp-devcontainer agent reference
coder_agent.main; the agent in that template iscoder_agent.dev(count-based), so they now usecoder_agent.dev[0].id.incus provider schema drift
incus_volume→incus_storage_volumeincus_cached_image→incus_image(object-formsource_image = { remote, name })incus_instance_fileresource; the agent token is now delivered via cloud-initwrite_files(consistent with how the init script and systemd units are already delivered).limitsintoconfig(limits.cpu/limits.memory) and updatedcoder_metadatareferences accordingly.Validation
All 14 previously-failing templates now pass
terraform validate:terraform fmt/ prettier applied. No.terraformartifacts or lockfiles committed.Note
Changes are confined to template
main.tffiles. The incus rework in particular adapts to the currentlxc/incusprovider schema; the token-via-cloud-init approach matches the siblingbpmct/incus-*templates.Generated with Mux.