Interview Prep/Terraform/Testing Upgrades and Large-Scale Operations

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 →

  1. Read the changelogs for each minor version.
  2. Upgrade the CLI in a branch with dev state; run plan: expect no changes.
  3. Roll through stage then prod; keep prod on the old CLI until the others are clean.
  4. Bump required_version last.

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.

All Terraform questions Roadmap: Terraform in production

More on Testing Upgrades and Large-Scale Operations