You are asked to design a VPC for a three-tier web app. What does the layout look like?
BeginnerScenarioVPC and Networking
Answer
Situation read → Public only for what must face the internet; everything else private across at least two AZs.
What I'd do →
- Pick a /16 such as
10.20.0.0/16and carve /20 or /24 subnets per tier per AZ - Public subnets hold ALB and NAT gateways, private app subnets hold compute, isolated data subnets hold RDS with no internet route
- Route tables: public to IGW, private to NAT, data with local only
- Security groups chained: ALB to app to DB by SG reference
Why → Tier isolation and SG referencing limit lateral movement and keep rules readable.
Interview tip → Leave spare CIDR space; resizing a VPC later hurts.
More on VPC and Networking
What is a VPC and what are the CIDR constraints?BeginnerWhat makes a subnet public or private?BeginnerHow do route tables work, including the local route and longest-prefix match?IntermediateInternet Gateway vs NAT Gateway: what does each do?BeginnerNAT Gateway vs NAT instance?IntermediateSecurity group vs network ACL: compare them.Beginner