Interview Prep/Terraform/Testing and Policy as Code

What does a contract test for a module look like?

AdvancedProductionTesting and Policy as Code
Answer

In tests/, one run block per documented behaviour: required inputs produce expected outputs, toggles create or skip resources, invalid inputs fail validation with expect_failures, and override_ or mock providers make it fast. Add one command = apply test against real AWS that checks outputs. Consumers can then upgrade confidently, because every promised behaviour has a test.

All Terraform questions Roadmap: Terraform in production

More on Testing and Policy as Code