Design a reusable module for a three-tier web service.
AdvancedProductionRepository Structure, Environments and Module Strategy
Answer
Inputs: VPC and subnet IDs, instance or container settings, DB class, domain and certificate ARN. Internals: ALB in public subnets, ASG or ECS service in private, RDS in isolated subnets, security groups chained by reference (alb to app to db), encryption on everything. Outputs: ALB DNS, service security group ID, DB endpoint (sensitive where needed). Add validation, sensible defaults, moved blocks for upgrades and examples with tests.
More on Repository Structure, Environments and Module Strategy
Monorepo or multi-repo for Terraform?BeginnerHow do you lay out environments in a repo?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?Beginner