Compare Terratest with `terraform test`.
IntermediateScenarioTesting Upgrades and Large-Scale Operations
Answer
Situation read → Picking an integration test tool.
What I'd do →
terraform test: native HCL, no extra language, supports plan and apply, mocks; ideal for module contracts.- Terratest: Go tests with full programming power, such as calling the deployed endpoint, retrying, SSH checks.
- Use native tests by default, and Terratest for end-to-end behaviour.
Why → Smaller toolchain wins unless you need to test the running system.
Interview tip → Mention cost and cleanup for either.
More on Testing Upgrades and Large-Scale Operations
What does each of `terraform validate`, `plan` and `terraform test` actually check?BeginnerWrite a native test for a module that creates an encrypted S3 bucket.IntermediateReal-cloud integration tests leave orphaned resources when they fail midway. How do you handle that?AdvancedHow do you upgrade from Terraform 1.5 to 1.9 safely?IntermediateMajor AWS provider upgrade from v4 to v5 (or v5 to v6) across many stacks. How do you plan it?AdvancedA stack is still on Terraform 0.12 syntax and old providers. What upgrade path do you follow?Advanced