Interview Prep/Terraform/Testing and Policy as Code

How do you control the cost and cleanliness of integration tests?

IntermediateProductionTesting and Policy as Code
Answer

Run them in a dedicated sandbox account with budgets and SCPs, use unique name suffixes per run, run on merge or nightly rather than per commit, always defer Destroy, and run a janitor (cloud-nuke or aws-nuke) for leaked resources. Use small instance sizes and skip slow resources (NAT gateways, RDS Multi-AZ) in test configs.

All Terraform questions Roadmap: Terraform in production

More on Testing and Policy as Code