Interview Prep/Terraform/Import Refactoring Drift and Lifecycle

The plan says an RDS instance "must be replaced" after a small code change. What do you do before approving?

AdvancedScenarioImport Refactoring Drift and Lifecycle
Answer

Situation read → Some attribute changes force replacement, which for a database means data loss.

What I'd do →

  1. Find the line marked # forces replacement in the plan.
  2. Stop. Take a manual snapshot.
  3. Check whether the change can be made in place (modify vs recreate), such as a parameter group change or apply_immediately.
  4. If replacement is unavoidable, restore from snapshot through snapshot_identifier or plan a migration.

Why → The plan tells you which attribute is immutable; the fix is a design change, not a flag.

Interview tip → Recognising "forces replacement" in plans is a core skill.

All Terraform questions Roadmap: Terraform in production

More on Import Refactoring Drift and Lifecycle