Building a Hub-and-Spoke Network with AWS Transit Gateway - Multi-VPC Connectivity Design

Consolidate multiple VPCs and on-premises networks in a hub-and-spoke topology, establish security boundaries with route table isolation, and enable multi-region connectivity through peering.

Transit Gateway Overview

Transit Gateway is a service that connects multiple VPCs and on-premises networks in a hub-and-spoke topology. VPC peering provides one-to-one connections, and managing a full mesh becomes increasingly difficult as the number of VPCs grows. Transit Gateway acts as a single hub, consolidating all VPC and VPN connections.

Route Table Isolation and Multi-Account Support

By isolating Transit Gateway route tables, you can implement segmentation such as allowing production VPCs to communicate with each other while blocking communication with development VPCs, and making shared services VPCs accessible from all VPCs. Use RAM to share the Transit Gateway with other accounts, allowing each account's VPCs to attach. With Direct Connect Gateway integration, on-premises networks can access all VPCs through the Transit Gateway, eliminating the need to build separate VPN connections for each VPC.

Peering and Multi-Region Connectivity

Transit Gateway peering connects Transit Gateways in different regions, enabling you to build a multi-region hub-and-spoke network. Peering connections traverse the AWS global backbone, providing low-latency communication without going through the internet. Peering routes are configured as static routes, with each region's CIDR blocks advertised to the other. Transit Gateway Connect attachments let you establish GRE tunnels and BGP peering with SD-WAN appliances, integrating on-premises networks through dynamic routing. You can also create multicast domains on Transit Gateway to distribute multicast traffic across VPCs. For a systematic understanding of network design from fundamentals to advanced topics, books on Amazon are a great resource.

Transit Gateway Pricing Structure

Transit Gateway pricing consists of attachment charges (hourly billing per VPC, VPN, or Direct Connect Gateway) and data processing charges. Each attachment costs approximately $0.05/hour (about $36/month), and in environments with many VPCs, attachment fees become the primary cost driver. Data processing is charged at approximately $0.02 per GB. Peering attachments incur additional inter-region data transfer charges. By analyzing traffic patterns between VPCs and using VPC peering (no data processing charges) for high-traffic VPC pairs alongside Transit Gateway, you can reduce data processing costs. Use Flow Logs to visualize traffic passing through Transit Gateway for cost optimization decisions.

Summary

Transit Gateway is a service that consolidates multi-VPC networks in a hub-and-spoke topology. It establishes security boundaries between production, development, and shared services through route table isolation, and builds multi-region networks through peering. Connect attachments enable GRE/BGP integration with SD-WAN, and Flow Logs visualize traffic patterns to support cost optimization decisions.