Interview Prep/Terraform/Testing and Policy as Code

What is policy as code and where does it run?

BeginnerProductionTesting and Policy as Code
Answer

Rules about what infrastructure is allowed (encryption, regions, instance types, tags) written as code and evaluated automatically. They run at several points: pre-commit for speed, in CI on the plan JSON, in HCP Terraform between plan and apply (Sentinel or OPA), and in the cloud through SCPs and Config.

All Terraform questions Roadmap: Terraform in production

More on Testing and Policy as Code