Interview Prep/Terraform/State and Backends in Production

How do you prevent teams from running stacks with local backends?

AdvancedProductionState and Backends in Production
Answer

CI policy: fail the pipeline if no backend or cloud block exists (grep or a Checkov/OPA rule on the config), run terraform init with -backend=true only, and remove human IAM write access to production so only the pipeline's role can apply. Add a template repo that already includes a correct backend.

All Terraform questions Roadmap: Terraform in production

More on State and Backends in Production