Interview Prep/Networking/VPC & Network Architecture

How would you design a production VPC for a three-tier web application?

IntermediateProductionVPC & Network Architecture
Answer

Three subnet tiers in at least three AZs: public (ALB, NAT gateways), private app (compute), private data (RDS, ElastiCache) with no route to the internet. Size the VPC /16 with /20 or /22 subnets so growth does not force a redesign.

Security groups chain by reference: ALB SG to app SG to DB SG. Add gateway endpoints for S3/DynamoDB, interface endpoints for the services you call heavily, VPC flow logs to S3 or CloudWatch, and manage everything in Terraform.

flowchart LR
  U[Users] --> ALB[ALB public subnets]
  ALB --> APP[App private subnets]
  APP --> DB[(Data private subnets)]
  APP --> NAT[NAT gateway]
  NAT --> IGW[Internet gateway]
All Networking questions Roadmap: Networking for DevOps

More on VPC & Network Architecture