Walk through a production VPC layout for a multi-tier app.
BeginnerProductionVPC and Network Design
Answer
Three AZs, three subnet tiers per AZ:
flowchart TD
IGW["Internet Gateway"] --> Pub["Public subnets x3: ALB, NAT GW"]
Pub --> App["Private app subnets x3: ECS, EKS, EC2"]
App --> Data["Isolated data subnets x3: RDS, ElastiCache"]
App --> NAT["NAT GW per AZ"] --> IGW
App --> EP["VPC endpoints: S3, ECR, STS, Logs"]
Public subnets hold only load balancers and NAT gateways. App subnets route 0.0.0.0/0 to the NAT in the same AZ. Data subnets have no route to the internet at all. Size app subnets generously (/19 or /20) because EKS and Lambda eat IPs.
More on VPC and Network Design
How do you size VPC CIDRs to avoid painting yourself into a corner?IntermediateOne NAT gateway or one per AZ?BeginnerWhat are the biggest levers to reduce NAT gateway cost?IntermediateWhich VPC endpoints do you create by default in a private EKS or ECS VPC?IntermediateHow do you lock down what can go through a VPC endpoint?AdvancedHub-and-spoke with Transit Gateway: how do you design route tables?Advanced