How do you protect state against region loss or accidental deletion?
AdvancedProductionState and Backends in Production
Answer
Versioning plus cross-region replication of the bucket, MFA delete or an Object Lock retention for the most critical states, deny-delete bucket policies, and periodic restore tests. Keep the KMS key multi-region or ensure replicated data can be decrypted in the DR region. A backup nobody has restored is only a hope.
More on State and Backends in Production
Why should Terraform state never be committed to Git?BeginnerHow do you bootstrap the remote backend, given the bucket must exist before Terraform can use it?IntermediateWhat does a hardened S3 state bucket look like?IntermediateWhat is the minimum IAM permission set for the S3 backend?IntermediateHow do you move from DynamoDB locking to S3 native locking in a live fleet?IntermediateState was deleted or corrupted. How do you recover?Advanced