How do you enforce encryption and tagging standards on every team's infrastructure?
IntermediateScenarioModules and Code Structure
Answer
Situation read → Standards should be built in, not remembered.
What I'd do →
- Publish golden modules (encrypted S3, tagged RDS) as the default way to build.
- Enforce with policy as code in CI (Checkov, OPA/Conftest, or Sentinel) on the plan JSON.
- Add org guardrails (SCPs, AWS Config rules) as the backstop for anything outside Terraform.
Why → Modules make the right thing easy, policy makes the wrong thing hard, and SCPs catch the rest.
Interview tip → Mention both shift-left and runtime controls.
More on Modules and Code Structure
When do you turn a block of resources into a module, and when do you leave it alone?BeginnerHow do you consume a community module like `terraform-aws-modules/vpc/aws` responsibly?BeginnerAn ECS service module needs the VPC and subnets created by a network module. How do you wire them together?IntermediateHow would you lay out a repo that deploys the same stack to dev, stage and prod?IntermediateHow do you release a shared module so consumers can upgrade at their own pace?IntermediateA module needs to deploy to a second region. Why does putting a provider block inside the module cause trouble?Advanced