Updated on 2024-08-07 GMT+08:00

VPC Peering Connection Usage Examples

A VPC peering connection is a networking connection between two VPCs in the same region and enables them to communicate. Table 1 lists different scenarios of using VPC peering connections.

Table 1 VPC peering connection usage examples

Location

CIDR Block

Description

Example

VPCs in the same region

  • VPC CIDR blocks do not overlap.
  • Subnet CIDR blocks of VPCs do not overlap.

You can create VPC peering connections to connect entire CIDR blocks of VPCs. Then, all resources in the VPCs can communicate with each other.

Using a VPC Peering Connection to Connect Two VPCs

VPCs in the same region

  • VPC CIDR blocks overlap.
  • Some subnet CIDR blocks overlap.

You can create VPC peering connections to connect specific subnets or ECSs from different VPCs.

  • To connect specific subnets from two VPCs, the subnet CIDR blocks cannot overlap.
  • To connect specific ECSs from two VPCs, each ECS must have a unique private IP address.

Using a VPC Peering Connection to Connect Subnets in Two VPCs

Using a VPC Peering Connection to Connect ECSs in Two VPCs

VPCs in the same region

  • VPC CIDR blocks overlap.
  • All subnet CIDR blocks overlap.

VPC peering connections are not usable.

Unsupported VPC Peering Configurations

Alternatively, you can use enterprise routers to connect VPCs in the same region. Enterprise Router is more suitable for complex networking that needs to connect multiple VPCs. With enterprise routers, you do not have to create a large number of VPC peering connections or add too many routes. This makes your network topology simpler and more scalable.

All route tables in a VPC can have a maximum of 1,000 routes. If you want to create VPC peering connections to connect multiple VPCs, consider this restriction when planning the networking.