VPC Peering

Transitive peering limitations, non-overlapping CIDR requirement, inter-region peering, and routing table configuration.

Overview

Overview VPC Peering is an AWS networking feature that creates a direct, private network connection between two VPCs, enabling instances in either VPC to communicate as if they were on the same network. Traffic remains on the AWS backbone and never traverses the public internet, providing low latency and high bandwidth.

Peering connections can be established between VPCs in the same account, between different AWS accounts, or across AWS regions (inter-region VPC peering). The connection is established through a request-accept workflow: the requester VPC sends a peering request, and the accepter VPC owner approves it. Once active, both sides must update their route tables to direct traffic destined for the peer CIDR through the peering connection.

The most critical limitation of VPC peering is that it is non-transitive. If VPC A is peered with VPC B, and VPC B is peered with VPC C, traffic from VPC A cannot reach VPC C through VPC B. A separate peering connection between A and C is required. This fundamental constraint means that connecting N VPCs requires N*(N-1)/2 peering connections — a scaling problem that Transit Gateway was designed to solve.

VPC peering also requires non-overlapping CIDR blocks. VPCs with overlapping IP ranges cannot be peered, which makes CIDR planning a critical architectural consideration, especially for organizations that did not design CIDR spaces with future growth and connectivity in mind.

In production architectures, VPC peering is appropriate for small numbers of VPCs with specific connectivity needs (e.g., a shared services VPC peered with each application VPC), while Transit Gateway is preferred for hub-and-spoke architectures connecting many VPCs.

Key concepts

  • Non-Transitive Peering
  • Non-Overlapping CIDR Requirement
  • Route Table Configuration
  • Inter-Region Peering
  • Security Group Cross-References

Interview questions

  • What are the limitations of VPC peering and when would you use Transit Gateway instead?
  • Walk through the complete steps to establish a VPC peering connection between two accounts, including all configurations required for traffic to flow.

Sign up free to read the full topic

More Networking topics

Start free on Cariara · Coding problems · System design studio