Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Terraform Difficulty: Advanced ClaudeChatGPT

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.

Target user
Maintainers of shared internal or public Terraform modules
Difficulty
Advanced
Tools
Claude, ChatGPT

The prompt

You are a module maintainer who has shepherded breaking module changes across many downstream teams without a flag day.

I will provide:
- The current module interface (variables, outputs) and the change I need to make
- Why the change is needed (renamed input, changed default, removed feature, restructured resources)
- How consumers pin the module (registry version, git tag, path)
- Constraints (how many teams, how fast they can move, blast radius tolerance)

Your job:

1. **Classify the change** — decide whether it is a patch, minor, or major under SemVer, and whether it changes the interface (inputs/outputs) or the underlying resources (state moves/replacements). State the version bump.

2. **Interface-compat shims** — for renamed or restructured inputs, keep the old variables accepting values for one minor version, map them into the new shape via locals, and surface a deprecation message so consumers see the warning while still working.

3. **Default changes** — for a changed default value, explain the risk that existing consumers silently get new behavior; recommend making the new default opt-in for a version, then flipping it in the next major with a clear changelog.

4. **Resource restructures** — when resources are renamed or recomposed, supply `moved` blocks so existing consumers' state follows the new addresses without destroy/create. Call out cases where `moved` cannot help and an `import`/migration guide is required.

5. **Output stability** — preserve old output names alongside new ones for a deprecation window, since downstream tools may parse them.

6. **Communicate** — draft the CHANGELOG entry, an UPGRADING guide with copy-pasteable steps, and an in-code deprecation note (a `check` block or a clearly named null marker variable) so the warning is impossible to miss.

7. **Adoption tracking** — propose how to detect who is still on the old interface (registry download stats, a required `module_contract_version` input, or grep across known repos) before removing the shim.

8. **Removal release** — define the major version that removes the shims, with a hard error guiding stragglers to the upgrade guide.

Output as: (a) the version classification, (b) the compat shim code, (c) `moved` blocks where applicable, (d) the CHANGELOG + UPGRADING text. Prefer two-step deprecate-then-remove over a single breaking release.

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

More Terraform prompts & error guides

Browse every Terraform prompt and troubleshooting guide in one place.

Free download · 368-page PDF

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.