Transit gateway or Direct Connect gateway
The names are similar and the two are frequently deployed together, but they solve different problems.
A Direct Connect gateway extends Direct Connect connections to VPCs in more than one Region. It is a fan-out point for a physical circuit, not a router: two VPCs behind the same Direct Connect gateway can each reach on-premises, but not each other.
A transit gateway is a general-purpose regional hub that routes between everything attached to it — VPCs, VPN connections and Direct Connect gateways — with route tables that let you decide what may reach what.
Use a transit gateway when
Section titled “Use a transit gateway when”- Several VPCs need to reach each other, especially across accounts.
- You want hub-and-spoke rather than a mesh of peering connections.
- Routing needs to be controlled at a granularity finer than “everything reaches everything”, using several route tables.
- VPCs must reach more than one on-premises network.
- You need multicast routing.
- There are enough connections that centralised route management is worth paying for — it scales to thousands of attachments.
Use a Direct Connect gateway when
Section titled “Use a Direct Connect gateway when”- On-premises must reach VPCs through Direct Connect, and those VPCs are in more than one Region.
- You want one set of virtual interfaces rather than one per VPC.
- Compliance requires private connectivity, or the workload needs consistent bandwidth and latency that the public internet cannot promise.
- Data transfer volumes make internet egress the dominant cost.
Using both
Section titled “Using both”The common hybrid design uses both: a Direct Connect gateway terminates the circuits and associates with a transit gateway in each Region; the transit gateway routes between the VPCs. Traffic from on-premises enters through the Direct Connect gateway and is routed onwards by the transit gateway, which is what allows on-premises to reach every VPC and the VPCs to reach each other.
The relevant quotas: a Direct Connect gateway associates with up to 20 virtual private gateways or up to 6 transit gateways, and a transit gateway associates with up to 20 Direct Connect gateways. None of these can be increased.