VPC Peering Fundamentals
What you'll learn: How to connect two VPCs together so they can communicate privately without traffic traveling over the public internet.
What is VPC Peering?
VPC peering creates a direct, private network connection between two Virtual Private Clouds (VPCs). Think of it like building a secure tunnel between two separate office buildings — employees can walk between them without going outside onto the street.
Once peered, resources in each VPC can communicate using their private IP addresses, just as if they were in the same network. No internet gateway needed, no public IPs required.
Why Use VPC Peering?
You might want to peer VPCs when:
- Different environments need to share data (production database accessed by analytics VPC)
- Separate teams own different VPCs but need interconnection
- Compliance requires network isolation but some controlled access is needed
- Cost optimization — private traffic avoids data transfer charges through the public internet
Key Characteristics
Non-transitive: If VPC-A peers with VPC-B, and VPC-B peers with VPC-C, VPC-A cannot automatically talk to VPC-C. You'd need a direct A-to-C peering connection.
No overlapping CIDR blocks: The IP address ranges in both VPCs must be different. You can't peer two VPCs that both use 10.0.0.0/16.
Requires route table updates: After establishing the peering connection, you must add routes in each VPC's route tables pointing to the other VPC's CIDR range via the peering connection.
Key Takeaway: VPC peering creates a secure, private connection between two isolated networks, enabling them to communicate directly without internet exposure, but requires non-overlapping IP ranges and explicit routing configuration.