How do you lay out environments in a repo?
BeginnerProductionRepository Structure, Environments and Module Strategy
Answer
live/
dev/ap-south-1/network/ main.tf backend.hcl terraform.tfvars
prod/ap-south-1/network/
modules/
vpc/ eks/ rds/
Each leaf directory is a stack with its own state. Environments differ in values, not in code, and modules are consumed by version. The extra files are repetitive but explicit and safe to review.
More on Repository Structure, Environments and Module Strategy
Monorepo or multi-repo for Terraform?BeginnerWhen would you adopt Terragrunt?BeginnerDo you use tfvars files per environment or code branches?IntermediateHow do you promote a module change from dev to qa to prod?AdvancedWhat is an internal module registry strategy?BeginnerHow would you structure multi-account AWS with Terraform?Intermediate