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

Does Terraform have rollback? How do you undo a bad change?

AdvancedScenarioTesting Upgrades and Large-Scale Operations
Answer

Situation read → A change made things worse.

What I'd do →

  1. Revert the commit and apply (roll forward with the old code).
  2. For replaced resources, recreate from the previous config; stateful data comes from backups.
  3. If state is wrong, restore the previous state version from S3 versioning, then plan.

Why → Terraform has no transactional rollback; "revert in Git and apply" works for stateless resources only.

Interview tip → Distinguish stateless (easy) from stateful (needs backups).

All Terraform questions Roadmap: Terraform in production

More on Testing Upgrades and Large-Scale Operations