Interview Prep/Terraform/State Backends and Workspaces

How do you harden the S3 bucket that holds Terraform state?

IntermediateScenarioState Backends and Workspaces
Answer

Situation read → State holds secrets and is the keys to the kingdom.

What I'd do →

  1. Turn on versioning so you can roll back a bad write.
  2. Enable default SSE-KMS encryption.
  3. Block all public access.
  4. Add a bucket policy that denies non-TLS requests and restricts access to the CI role and a break-glass role.
  5. Enable access logging or CloudTrail data events.

Why → Versioning is your undo; IAM scoping and encryption protect the secrets inside.

Interview tip → Put the bucket in a dedicated tooling account.

All Terraform questions Roadmap: Terraform in production

More on State Backends and Workspaces