What is VPC Peering in AWS?
VPC Peering is a networking connection between two VPCs that allows resources in one VPC to communicate with resources in another VPC using private IP addresses.
This means traffic stays on AWS private infrastructure instead of going out to the public internet.
Real-life example
Think of two office buildings owned by the same company. Instead of employees walking outside on public roads to carry files between them, the company creates a private walkway connecting the two buildings directly. VPC Peering is like that private walkway between two AWS networks.
Why is VPC Peering important?
VPC Peering matters when you have workloads split across different VPCs but still need them to communicate privately and securely.
VPC Peering helps you:
- Connect application environments across separate VPCs
- Keep traffic private between networks
- Support shared services across VPCs
- Avoid exposing internal traffic to the internet
When do you use VPC Peering?
You use VPC Peering when two VPCs need direct communication and the design is still simple enough that full hub-and-spoke networking is not required.
Common cases include:
- One VPC hosts an application and another hosts shared backend services
- Separate AWS accounts need private connectivity
- Development and shared tooling VPCs need communication
- Small multi-VPC environments need direct connectivity
Example scenario
Suppose one VPC hosts your application servers and another VPC hosts centralized logging or monitoring tools. VPC Peering allows those environments to talk privately using internal IP addresses.
Where does VPC Peering fit in AWS architecture?
VPC Peering sits between separate VPC networks. It is not attached to a subnet like a NAT Gateway and not attached to the internet like an Internet Gateway. Instead, it creates a direct relationship between two VPCs.
- Two VPCs exist with non-overlapping CIDR ranges
- A VPC Peering connection is created between them
- Route tables in each VPC are updated
- Security groups and NACLs must allow the traffic
- Resources can then communicate privately across VPCs
Who should understand VPC Peering?
VPC Peering is relevant to:
- Cloud engineers designing multi-VPC environments
- DevOps engineers troubleshooting private connectivity
- Platform engineers creating shared network services
- Security teams reviewing private traffic paths between environments
How does VPC Peering work?
VPC Peering works by creating a private network connection between two VPCs. After the peering connection is created, route tables must be updated so that traffic destined for the other VPC knows where to go.
- Create a peering connection between VPC A and VPC B
- Accept the peering request if required
- Add routes in both VPC route tables
- Allow traffic in Security Groups and NACLs
Without route updates, the peering connection exists but traffic still will not flow.
Important requirement: non-overlapping CIDR ranges
Two VPCs cannot be peered if their CIDR ranges overlap. This is because AWS would not know how to route traffic correctly between them.
That is why planning IP ranges carefully at the beginning of cloud design is so important.
VPC Peering vs Transit Gateway
Beginners often compare these two:
- VPC Peering: direct one-to-one connection between two VPCs
- Transit Gateway: central hub that connects many VPCs and networks
VPC Peering is simpler for small environments. Transit Gateway is better for larger, more scalable enterprise designs.
Limits and design considerations
- VPC Peering does not support transitive routing
- If VPC A is peered with VPC B, and VPC B is peered with VPC C, VPC A cannot automatically reach VPC C
- Managing many peering connections can become complex
- Route tables and security rules must still be maintained carefully
Simple limitation example
If you have three or more VPCs that all need to communicate, creating many separate peering links can become messy. In those cases, Transit Gateway usually becomes the better design choice.
Common mistakes
- Trying to peer VPCs with overlapping CIDR ranges
- Creating the peering connection but forgetting route table updates
- Assuming Security Groups are automatically enough without checking NACLs
- Expecting transitive routing to work through other peered VPCs
Best practices
- Plan CIDR ranges carefully to avoid overlap
- Use VPC Peering for simpler one-to-one or small-scale connectivity
- Document route table changes clearly
- Review whether Transit Gateway is a better fit as environments grow
- Validate connectivity with both routes and security controls
Summary
AWS VPC Peering is a private connection between two VPCs that allows secure communication using internal IP addresses. It is simple, effective, and useful for smaller multi-VPC designs. Once you understand route tables, CIDR planning, and the lack of transitive routing, VPC Peering becomes much easier to use correctly.
Learn more from AWS official documentation
For deeper technical details, refer to AWS VPC Peering documentation .