How do you upgrade from Terraform 1.5 to 1.9 safely?
IntermediateScenarioTesting Upgrades and Large-Scale Operations
Answer
Situation read → A multi-version jump across many stacks.
What I'd do →
- Read the changelogs for each minor version.
- Upgrade the CLI in a branch with dev state; run
plan: expect no changes. - Roll through stage then prod; keep prod on the old CLI until the others are clean.
- Bump
required_versionlast.
Why → After a newer version writes state, older versions can't read it; rollout order matters.
Interview tip → Take a state backup before the first apply with the new CLI.
More on Testing Upgrades and Large-Scale Operations
What does each of `terraform validate`, `plan` and `terraform test` actually check?BeginnerWrite a native test for a module that creates an encrypted S3 bucket.IntermediateCompare Terratest with `terraform test`.IntermediateReal-cloud integration tests leave orphaned resources when they fail midway. How do you handle that?AdvancedMajor AWS provider upgrade from v4 to v5 (or v5 to v6) across many stacks. How do you plan it?AdvancedA stack is still on Terraform 0.12 syntax and old providers. What upgrade path do you follow?Advanced