Interview Prep/Terraform/State Backends and Workspaces

How do you protect state for disaster recovery?

AdvancedScenarioState Backends and Workspaces
Answer

Situation read → State is a critical asset; regional loss shouldn't block recovery.

What I'd do →

  1. Enable versioning, and optionally Object Lock for compliance.
  2. Replicate the bucket cross-region (CRR) to a DR bucket in a separate account.
  3. Practice a restore, including pointing -backend-config at the DR bucket.
  4. Keep bootstrap code and runbooks outside the same region and account.

Why → Versioning covers mistakes, replication covers regional failure, and rehearsal proves it works.

Interview tip → You can't fix prod with Terraform in an outage if the state bucket is in the failing region.

All Terraform questions Roadmap: Terraform in production

More on State Backends and Workspaces