VPC design
CIDR planning that survives 5 years, public/private/isolated subnet tiers, route tables, NAT gateway placement (and its per-GB cost trap), security groups vs NACLs.
The mental model
A VPC is a private plot of land you fence off inside AWS's shared city. Within your fence you lay out streets (subnets), decide which streets have a gate to the public road (public subnets) and which are deliberately buried in the interior with no way out (private and isolated subnets), install checkpoints on every building's door (security groups) and on every street corner (network ACLs), and draw the map of which street connects to which (route tables). AWS gives you the empty plot and the tools; the layout is entirely yours, and a bad layout is expensive to rebuild once buildings are on it.
Why this exists and why it is a senior-loop staple: the VPC is the network foundation every other service sits inside, and the two mistakes it invites are both costly. Under-plan the address space and you run out of room in year three, forced into an ugly second VPC and peering just to grow. Under-plan the routing and you either leak a private database onto the internet (a breach) or pour money through a NAT gateway (a bill). The CIDR you pick on day one and the placement of one NAT gateway are decisions you live with for years, which is exactly why interviewers open with "design a VPC for a multi-team org."
The core insight: subnets are not security, they are routing. What makes a subnet "private" is not a label — it is that its route table has no path to an internet gateway. Security is the security group on the resource. Confusing the two is the most common conceptual error, and getting it straight is what separates someone who has drawn a VPC diagram from someone who has debugged a packet through one.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision