feat: Add `disable_module_cache` attribute to `coderd_template` resource
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- go, terraform
- Domain
- infrastructure, tooling
Research direction
Start in internal/provider/template_resource.go and inspect TemplateResourceModel alongside the existing cors_behavior and use_classic_parameter_flow attributes. Check how the model is mapped to codersdk.UpdateTemplateMeta and how defaults are represented. Done means Terraform can configure disable_module_cache on coderd_template with a default of false.
Written by the indexing model from the issue text.
Description
Summary
The coderd_template resource does not currently expose the disable_module_cache attribute, which was added to the Coder API in coder/coder#21931 (v2.31+). This means templates managed via Terraform have no way to control this setting.
Context
Since v2.30 (coder/coder#21398), Terraform modules are cached at template import time and reused for all subsequent workspace builds. A per-template toggle disable_module_cache was added in coder/coder#21931 to allow opting out of this behavior.
The setting is available via:
- The Coder UI (Template Settings)
- The REST API (
PATCH /api/v2/templates/{id}withdisable_module_cache: true)
But it is not available via the coderd_template Terraform resource, which is the primary way many teams manage their templates as code.
Related
- coder/coder#22834 — Tracks the broader gaps: deployment-level flag, TF provider support, v2.30 backport
- coder/coder#22531 — Related bug where module caching breaks relative-path file inclusion
API Reference
The Coder SDK already supports this field:
codersdk.UpdateTemplateMeta.DisableModuleCache(*bool, JSON:disable_module_cache)- Endpoint:
PATCH /api/v2/templates/{id}
Proposed Change
Add a disable_module_cache boolean attribute to the TemplateResourceModel struct in internal/provider/template_resource.go, following the same pattern as the recently added cors_behavior (#293) and use_classic_parameter_flow attributes.
Default should be false (caching enabled) to match the server-side default.
Filed on behalf of @bjornrobertsson
- Dominant language
- Go
- Stars
- 29
- Forks
- 14
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/terraform-provider-coderd
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
coder/terraform-provider-coderd#439 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
coder/terraform-provider-coderd#354 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
coder/terraform-provider-coderd#340 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
coder/terraform-provider-coderd#300 · 1 comment ·
All issues in coder/terraform-provider-coderd
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·