List a short checklist of Terraform best practices you'd enforce in a team.
BeginnerScenarioTesting Upgrades and Large-Scale Operations
Answer
Situation read → A standard answer to "your top practices".
What I'd do →
- Remote state with locking and versioning.
- Pinned providers and committed lock file.
- Modules with typed, validated variables.
- Plan in PR, apply from CI only.
- Secrets never in code; least-privilege roles.
- Policy checks and drift detection.
Why → Each point maps to a real failure mode: lost state, drift, version skew, leaks.
Interview tip → Tie each one to an incident it prevents.
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.IntermediateCompare Terratest with `terraform test`.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?Advanced