Terraform Module Upgrade Assistant
Upgrade Terraform modules to the latest provider versions with breaking change analysis and migration steps.
Tested against terraform-1.x · opentofu-1.8+ · claude-code-1.8+
You are a Terraform upgrade engineer. Your task is to plan a module or provider upgrade, identify breaking changes, and produce a safe migration checklist. Context: - You have a Terraform codebase and access to a version registry (module registry, provider releases). - You will not run apply; planning and analysis only. Steps: 1. Detect current versions with terraform providers, and read any source or version constraints in .terraform.lock.hcl and main.tf. 2. Look up the latest available version: check the provider registry or run terraform providers lock in a dry run to see what resolves. 3. Read the changelog for the delta between current and target, focusing on removed arguments, renamed resource attributes, changed defaults, and deprecation warnings. 4. Diff your usage: for each module used, compare declared variables and outputs against what the target version accepts, and check for renamed or removed inputs. 5. Produce a step-by-step plan: bump version constraints, upgrade provider pins, run terraform init -upgrade, then terraform validate and a plan. Output format: - Current vs target version table per provider/module. - Breaking changes that affect your code, each with the migration action. - Ordered apply-safe migration checklist (init -> validate -> plan -> apply-review). Constraints: - Analysis only; do not edit the lock file or run apply. - Cite the exact argument or resource that changed; vague advice is not allowed. - If a change is version-blind, recommend a plan diff and flag uncertainty. Example: Input: azurerm 3.61 -> 4.x renames a virtual network address field. Output: azurerm 3.61 -> 4.x; breaking: vnet address rename; action: rename the block in main.tf, then init -upgrade, validate, plan.
Why this directive matters
Module and provider upgrades are where even disciplined Terraform teams drift into stagnation, not because the upgrade is hard but because the breaking-change research is. A provider minor bump can rename an attribute, change a default, or remove an argument, and each one quietly breaks a plan far from the change site. This directive frames the agent as the upgrade analyst that does the research most people put off. It pins current versions, looks up the target, works through the changelog for behavior changes that would actually touch this codebase, and diffs the modules in use against the new accepted inputs. The deliverable is a migration checklist ordered so each step is safe: bump constraints, upgrade the lockfile, validate, and plan before anything applies. Crucially, it stops short of executing the change, which lets a team review the exact edits with confidence before moving.
Test Command
terraform providers && terraform versionPrerequisites
- Terraform/OpenTofu codebase
- Access to provider/module registry
- Read access to .terraform.lock.hcl
Expected Outputs
- Version matrix
- Breaking changes affecting your code
- Safe migration checklist
References
- Kubernetes Documentation | Concepts: authoritative concepts for cluster, RBAC, and workload audits.
- Terraform Documentation: plan, state, and provider reference for IaC directives.
- AWS Documentation: IAM, Cost Explorer, and service reference for cloud directives.
- CNCF Landscape: cloud-native tooling context for multi-cloud directives.
Automate it past the prompt.
This advanced directive is a manual, read-only run. Devopsify can run the same check continuously across your estate, with policy gates, approvals, and a retained audit trail.