Every resource you run on AWS — an EC2 instance, a database, a load balancer — lives inside a Virtual Private Cloud. The VPC is your isolated network: your IP ranges, your subnets, your firewalls, your route to the internet. Get the design right and everything else is easy. Get it wrong and you pay for it twice: once in outages, once in the bill.
Most VPC problems are not AWS problems. They are design problems: a CIDR block too small to grow, a database in a public subnet, a NAT gateway bill nobody predicted, a security group that allows the whole internet. This post covers how production teams actually design a VPC — subnets, route tables, NAT gateways, security groups and NACLs — and the pitfalls that only show up at scale.
What a VPC Actually Is
A VPC is a logically isolated section of the AWS cloud where you launch resources in a virtual network you define.…