Volume 2 · Chapter 10 — AWS Networking Deep Dive (VPC)
Hybrid Connectivity in Depth: VPN, Direct Connect, and Transit Gateway
10.1 Introduction
Hybrid connectivity is one of the densest professional-exam topics, and the earlier overview needs deepening into the actual components: the parts of a Site-to-Site VPN, the types of Direct Connect virtual interfaces and resiliency models, and how Transit Gateway routing, attachments, and peering work. This chapter provides that depth, because designing enterprise hybrid networks correctly is a core architect responsibility.
10.2 Site-to-Site VPN Components
ASite-to-Site VPNhas defined parts. On the AWS side, aVirtual Private Gateway (VGW)attaches to your VPC (or you terminate on a Transit Gateway); on your side, aCustomer Gateway (CGW)represents your on-premises router. The VPN connection providestwo encrypted IPsec tunnels(to two different AWS endpoints) for redundancy - you should configure your router to use both. Routing is eitherstatic(you define routes) ordynamic with BGP(routes are exchanged automatically, androute propagationcan add them to the VPC route table). The exam points: a VPN runs over the public internet (encrypted, quick, cheap, variable performance), provides two tunnels for HA, and BGP enables dynamic routing and failover. A VPN is often deployed as abackupto Direct Connect.
10.3 Direct Connect, Virtual Interfaces, and Resiliency
Direct Connect (DX)is a dedicated private physical connection from your data centre to AWS, via a DX location, giving consistent low latency and bandwidth that never traverses the internet. Over a DX you createvirtual interfaces (VIFs): aprivate VIFto reach VPC resources (private IPs), apublic VIFto reach AWS public services (like S3) over the private link, and atransit VIFto reach a Transit Gateway (via aDirect Connect Gateway, which also lets one DX reach VPCs in multiple Regions/accounts). Because a single DX is not redundant and takes weeks to provision, resiliency is designed deliberately: AWS defines resiliency models from a single connection up tohigh resiliency(connections at two DX locations) andmaximum resiliency(multiple connections across multiple locations). A common pattern isDX with a Site-to-Site VPN backup- if the DX fails, traffic fails over to the encrypted VPN. DX itself is not encrypted, so for encryption over DX you run a VPN over the public VIF or useMACsecon supported connections.
flowchart TB DC[On-prem data centre] --> DX[Direct Connect - dedicated private link] DC -.encrypted backup.-> VPN[Site-to-Site VPN over internet] DX --> PrivVIF[Private VIF -> VPC] DX --> PubVIF[Public VIF -> AWS public services e.g. S3] DX --> TransVIF[Transit VIF -> DX Gateway -> Transit Gateway] TransVIF --> TGW[(Transit Gateway - many VPCs/Regions)] VPN --> TGW
10.4 Transit Gateway Deep Dive
Transit Gateway (TGW)is the scalable hub that replaces a mesh of VPC peerings. VPCs, VPN connections, and Direct Connect (via transit VIF) connect to it asattachments. Crucially, TGW has its ownroute tables, and you associate attachments with route tables and propagate routes into them - this is how you implementsegmentation: for example, associate production and non-production VPCs with different TGW route tables so they can reach shared services but not each other. TGW supportsinter-Region peering(connecting TGWs in different Regions for a global network) and even multicast. Unlike VPC peering, TGW routingistransitive through the hub. The exam expects you to know TGW connects VPCs and on-premises at scale with central, segmentable routing, supports inter-Region peering, and is the answer whenever “many VPCs and hybrid connections” appears - while VPC peering suits a small number of VPCs needing direct, non-transitive links.
10.5 Choosing the Hybrid Design
The decision framework: for on-premises connectivity, useDirect Connectwhen you need consistent, private, high performance (with a VPN backup and a resiliency model matching your RTO), or aSite-to-Site VPNalone when quick, cheap, encrypted connectivity over the internet suffices or as DX backup. For connecting many VPCs and hybrid links, use aTransit Gatewayhub with segmented route tables, reaching it from on-premises via a transit VIF over a Direct Connect Gateway. For sharing a single service (including cross-account or with partners) without joining networks, usePrivateLink. Real enterprise designs combine these: DX (VPN backup) into a TGW hub, with PrivateLink for service sharing - each tool for its purpose.
10.6 Banking Production Scenario
A bank connects its data centres to AWS over redundant Direct Connect links at two DX locations (high resiliency), with Site-to-Site VPN as encrypted failover, terminating on a Direct Connect Gateway and transit VIF into a central Transit Gateway. The TGW’s route tables segment the estate: production VPCs, non-production VPCs, and a shared-services VPC are associated with different route tables so non-production can’t reach production, while both reach shared services. Inter-Region TGW peering links the primary and DR Regions. BGP provides dynamic routing and automatic failover to the VPN if a DX link drops. PrivateLink shares a single internal API with a fintech partner. This layered, segmented hybrid design is precisely the professional-level network architecture the certification targets.
10.7 Chapter Revision Notes
- Site-to-Site VPN: VGW (AWS side) + CGW (your side), two IPsec tunnels for HA, static or BGP dynamic routing with route propagation; over the internet, often a DX backup.
- Direct Connect: dedicated private link; VIFs = private (VPC), public (AWS public services), transit (TGW via DX Gateway); not encrypted (use VPN-over-DX or MACsec); design resiliency (single→high→maximum), commonly DX + VPN backup.
- Transit Gateway: hub for VPCs + VPN + DX (transit VIF); own route tables enable segmentation; supports inter-Region peering and multicast; transitive routing.
- VPC peering suits a small number of VPCs (direct, non-transitive, no overlap); TGW scales to many VPCs and hybrid with central segmentable routing.
- Combine: DX (VPN backup) → DX Gateway → TGW hub with segmented route tables; PrivateLink for single-service sharing.