Terraform Module SemVer & Release Strategy Prompt
Define a semantic-versioning and release process for an internal Terraform module library — what counts as breaking, how to tag, deprecate inputs, and let consumers pin safely across a fleet of root modules.
- Target user
- Module library maintainers governing internal consumers
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a Terraform module library owner who has burned consumers with surprise breaking changes and now runs a disciplined release process. I will provide: - My module repo layout (single repo vs monorepo of modules) - How consumers reference modules (git tags, registry, Terragrunt) - Recent painful changes that broke downstreams Your job: 1. **What is "breaking" in Terraform terms** — give a precise rubric: removing/renaming a variable, changing a default that forces replacement, changing an output name/type, raising the required Terraform/provider version, or any change that produces a destroy/recreate for existing consumers. Map these to MAJOR/MINOR/PATCH. 2. **Non-obvious breakers** — flag the sneaky ones: changing a `for_each` key, reordering a `count` list, tightening a variable `validation`, or changing a resource's `lifecycle`. Explain why each forces replacement and how to detect it pre-release. 3. **Deprecation flow** — how to retire an input without a major bump: keep the old variable, mark it deprecated in description, coalesce old+new with `coalesce`/`try`, emit a warning via a `check` block, and remove only on the next MAJOR. 4. **Tagging & pinning** — recommend tag scheme (`vMAJOR.MINOR.PATCH`), how consumers should pin (`?ref=v2.3.1` vs `~> 2.3` from a registry), and why floating `main` is banned. 5. **Changelogs & release notes** — a template with Added/Changed/Removed/Upgrade-notes; include a copy-pasteable migration snippet for each breaking change. 6. **CI for releases** — gate tags on: `terraform validate`, `tflint`, native tests, a plan against a fixture consumer to catch forced replacements, and conventional-commit-driven version bumping. 7. **Detecting forced replacement before release** — show a CI job that runs `terraform plan` of a pinned consumer against the new module and fails if any resource shows `# forces replacement`. Output: (a) the breaking-change rubric as a checklist, (b) a deprecation pattern in HCL, (c) a CHANGELOG template, (d) the release CI workflow, (e) consumer pinning guidance. Bias toward: protecting downstream consumers, explicit deprecation over silent breaks, and automated detection of forced replacements.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Terraform Module Version Pinning Audit Prompt
Audit module source version constraints across a Terraform estate to eliminate unpinned, drifting, and risky references.
-
Terraform Module Deprecation Path Prompt
Plan a non-breaking migration when a published Terraform module's interface or behavior must change, so existing consumers can upgrade gradually.
-
Terraform Module Output Contracts Prompt
Design stable, well-typed module outputs that downstream modules can depend on — output naming, sensitive marking, object vs flat outputs, and versioning the contract so consumers don't break on every refactor.
-
Terraform Module Registry Publishing Prompt
Publish a reusable module to a public or private registry the right way — repo naming and structure, semantic version tags, examples and docs, automated release, and a consumer-friendly versioning policy.
More Terraform prompts & error guides
Browse every Terraform prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.