Connecting Many Networks with AWS Transit Gateway
This lesson explains how AWS Transit Gateway, a Regional network hub, connects many VPCs, VPNs and Direct Connect gateways, replacing a mesh of peering connections with a hub-and-spoke design.
Learning outcomes
After completing this lesson, you will be able to:
- Describe how Transit Gateway attachments and route tables work.
- Choose between peering and Transit Gateway.
- Describe centralised inspection and egress designs.
- Identify related options such as Cloud WAN.
How Transit Gateway works
AWS Transit Gateway is a regional network hub that connects many VPCs and on-premises networks. Each VPC, Site-to-Site VPN connection, Direct Connect gateway or SD-WAN connection is an attachment, and routing between attachments is transitive, so every attached network can reach every other one through the hub, replacing a mesh of peering connections.
Route tables on the transit gateway control which attachments can reach each other, which allows networks to be segmented. Transit gateways in different Regions connect through inter-Region peering, and a transit gateway can be shared with other accounts through AWS RAM. Equal-cost multi-path (ECMP) routing across several VPN tunnels aggregates their bandwidth. Transit Gateway is charged per attachment per hour plus per gigabyte of data processed.
The following diagram shows a transit gateway with several kinds of attachment.

Peering or Transit Gateway?
VPC peering and Transit Gateway both connect VPCs, but they suit networks of different sizes. Peering is a point-to-point connection between two VPCs. It has no hourly charge, only data transfer, and adds no extra hop, so it suits a few VPCs that need to talk to each other. Because it is not transitive, each VPC needs its own VPN or Direct Connect path to on premises.
Transit Gateway is a regional hub to which VPCs, VPN connections and Direct Connect gateways attach. Routing through it is transitive, so every attached VPC can reach every other and share one connection to on premises, and route tables on the transit gateway can separate traffic, for example keeping production and development apart. It is charged per attachment per hour plus per gigabyte processed, which is worthwhile once there are more than a handful of VPCs. The following table summarises the differences.
Peering or Transit Gateway?
Centralised designs
A transit gateway enables several centralised network designs. In an inspection VPC design, traffic between VPCs or to the internet is routed through AWS Network Firewall or third-party appliances behind a Gateway Load Balancer; appliance mode on the attachment keeps both directions of each flow on the same appliance, which stateful inspection requires.
In centralised egress, spoke VPCs send internet traffic to one egress VPC with NAT gateways, which simplifies control and reduces the number of NAT gateways, at the cost of transit gateway processing charges. Route table segmentation isolates environments, for example ensuring that production and development VPCs cannot reach each other while both can reach shared services.
Centralised network designs
Related options
Two related options also connect or share networks. AWS Cloud WAN builds a global network across Regions and on-premises sites, managed through a central policy, which suits organisations with many Regions that would otherwise manage many transit gateways and peering connections.
VPC sharing, through AWS RAM, takes a different approach: a networking account owns a VPC and shares its subnets with other accounts, which launch their resources directly into those subnets. This reduces the number of VPCs that need to be connected at all, while each account still owns its own resources.
Connecting a growing number of VPCs
A company started with two VPCs connected by peering. It now has 12 VPCs that all need to reach a shared-services VPC and the on-premises network, and each other in some cases.
Transit Gateway is the scalable answer. Peering remains a good choice for a single high-volume connection between two VPCs, because it has no per-GB processing charge.
How can a Transit Gateway stop development VPCs from reaching production VPCs?
Show answer
With separate Transit Gateway route tables: development attachments are associated with a route table that has no routes to the production attachments.
Exam Tips
Remember for the exam
- For many VPCs and on-premises networks, use Transit Gateway.
- To isolate groups of VPCs while sharing services, use multiple transit gateway route tables.
- To inspect all traffic between VPCs with a firewall, use an inspection VPC behind the transit gateway with appliance mode.
- To share one set of NAT gateways among many VPCs, use a centralised egress VPC through the transit gateway.
- To connect transit gateways in different Regions, use transit gateway inter-Region peering.