How do you manage network infrastructure as code safely?
IntermediateProductionVPC & Network Architecture
Answer
Terraform modules for VPC, subnets, route tables and endpoints, remote state with locking, plan review in pull requests, policy checks (OPA, Checkov, Sentinel) rejecting 0.0.0.0/0 on sensitive ports, and separate state per environment. Make changes in small increments because route and NACL changes affect everything.
For risky edits we add prevent_destroy on VPCs and review terraform plan output for replacements of route tables or subnets.
More on VPC & Network Architecture
How would you design a production VPC for a three-tier web application?IntermediateHow many AZs and subnets should a production VPC use, and why?BeginnerWhat makes a subnet public versus private?BeginnerHow do you avoid NAT gateway single points of failure and cross-AZ charges?IntermediateWhen should you use VPC endpoints?IntermediateHow do you design connectivity for 50+ VPCs across accounts and regions?Advanced