Interview Prep/Real-World Interview/Infrastructure as Code & Terraform state

How did you protect critical resources from accidental deletion?

BeginnerBehavioralInfrastructure as Code & Terraform state
Answer

Good answer looks like → "lifecycle { prevent_destroy = true } on databases, state buckets and KMS keys; deletion_protection = true on RDS and load balancers; S3 versioning; and a CI check that fails if the plan contains any delete on resources tagged critical=true unless a specific PR label is present."

Follow-ups to expect → What if someone removes the prevent_destroy line? Did it ever save you?

Red flags → Relying only on "being careful".

All Real-World Interview questions Roadmap: Interview readiness

More on Infrastructure as Code & Terraform state