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

Connecting VPCs

Connecting VPCs in the Same Region

If the VPCs you want to connect are in the same region, you can use VPC Peering or Enterprise Router.

Connecting VPCs provides details about different network services.

Before connecting VPCs, you need to plan their CIDR blocks in advance. Overlapping CIDR blocks may cause communication failure.

With VPC Peering, you can peer two VPCs in the same region. The VPCs can be in the same account or different accounts.

In Figure 1, a VPC peering connection (Peering-AB) connects two VPCs (VPC-A and VPC-B) in a region.
Figure 1 Connecting VPCs in the same region over a VPC peering connection

An enterprise router can connect multiple VPCs in the same account or different accounts to set up a hub-and-spoke network. Compared with VPC Peering, Enterprise Router is more suitable for complex networking where many VPCs need to be connected.

For details, see Using an Enterprise Router to Enable Communications Between VPCs in the Same Region.

In Figure 2, an enterprise router connects multiple VPCs in the same region and forwards traffic among them. The routes are automatically configured for the VPCs and the enterprise router.
Figure 2 Connecting VPCs in the same region using an enterprise router

Connecting VPCs in Different Regions

If the VPCs to be connected are located in different regions, you can use Cloud Connect, Direct Connect, or VPN.

Connecting VPCs provides details about different network services.

Before connecting VPCs, you need to plan their CIDR blocks in advance. Overlapping CIDR blocks may cause communication failure.

You can use VPN connect VPCs in different regions, so that they can communicate with each other over the Internet.

In Figure 3, there is a VPC in each region: VPC-A in region A and VPC-B in region B. Each VPC is connected to a VPN connection. The two VPCs can communicate with each other through an encrypted channel on the Internet. VPN can be enabled fast and is cost-effective.
Figure 3 Connecting VPCs in different regions using VPN

You can use Direct Connect to connect VPCs in different regions.

In Figure 4, there is a VPC in each region: VPC-A in region A and VPC-B in region B. Each VPC is connected to a Direct Connect connection. The two VPCs can communicate with each other through a dedicated connection. Compared with VPN, Direct Connect enables faster, more stable data transmission.
Figure 4 Connecting VPCs in different regions using Direct Connect