AWS Transit Gateway Step by Step - Connect Many VPCs and On-Premises Through One Hub, VPC Attachments, Transit Gateway Route Tables, Associations and Propagations, Isolation, Peering, Pricing (AWS Part-13)


Part-12 ended with the problem - VPC peering is point-to-point and not transitive, so ten VPCs need 45 peering connections, and none of them can share a VPN to the office. AWS Transit Gateway is the fix: a regional router you attach every VPC, VPN and Direct Connect to once, and then control who reaches whom with route tables in the hub.

In this Part-13 I create a Transit Gateway, attach three VPCs, make dev and prod both reach a shared-services VPC while being isolated from each other, and look at VPN attachments, cross-region peering, cross-account sharing, cost and the errors. The console steps and the curl tests are from my recording in Frankfurt; the isolation pattern and the prices and quotas were re-checked on 2026-10-17.

TL;DR

  • A Transit Gateway is a regional hub router. Attach each VPC, VPN, Direct Connect gateway or peer Transit Gateway once; the hub forwards between them. Transitive by default, up to 5,000 attachments and 100 Gbps per VPC attachment per Availability Zone.
  • Routing has two layers and both are required: a route towards the hub in every VPC route table (one 10.0.0.0/8 summary works), and the transit gateway route tables inside the hub that decide where traffic goes next. Attachments Available plus ping failing is almost always the first layer missing.
  • In my recording: three VPCs (12.0.0.0/16, 13.0.0.0/16, 14.0.0.0/16), one attachment each with one subnet in eu-central-1a, two routes added per VPC route table, and curl between all three instances (12.0.1.225, 13.0.0.221, 14.0.0.95) answered with the other server's page every time.
  • Isolation is table design, not security groups: dev and prod attachments associated with a table that only knows the shared VPC; the shared VPC's table knows both. The Terraform for that pattern validates and plans 28 resources with AWS provider 6.69.1.
  • Cost: $0.05 per VPC attachment hour in N. Virginia, $0.06 in Frankfurt (from the AWS pricing feed, 2026-10-17), plus $0.02 per GB processed. Three VPCs is about $130 a month before traffic, which is why the rule stays: peer two or three VPCs, Transit Gateway for more.
  • Not your exact case? If you only need two VPCs talking, VPC peering, Part-12 is free; if you have Transit Gateways in several regions, Cloud WAN, Part-25 replaces them with one policy.

Table of Content

  1. What a Transit Gateway is and how it routes
  2. The vocabulary - attachments, TGW route tables, associations, propagations
  3. Prerequisites - three VPCs and a subnet per AZ for the attachments
  4. Step 1 - Create the Transit Gateway
  5. Step 2 - Create the VPC attachments
  6. Step 3 - Add routes in each VPC towards the Transit Gateway
  7. Step 4 - The Transit Gateway route table
  8. Step 5 - Test it with EC2
  9. Step 6 - Isolate dev from prod with separate route tables
  10. On-premises - VPN and Direct Connect attachments
  11. Transit Gateway peering across regions and sharing across accounts
  12. What it costs and the quotas
  13. The AWS CLI and Terraform equivalents
  14. Common Transit Gateway errors and how to fix them
  15. What broke when I ran this
  16. Conclusion



1. What a Transit Gateway is and how it routes

A Transit Gateway (TGW) is a highly available, scalable regional router that AWS runs for you. Instead of connecting VPCs to each other, you connect each of them to the TGW with an attachment, and the TGW forwards packets between attachments according to its own route tables. The how it works page describes it as a hub-and-spoke: a transit gateway acts as a Regional virtual router for traffic flowing between your virtual private clouds (VPCs) and on-premises networks.

What that gives you over peering -

  1. Transitive routing - A, B and C attach once and can all talk (if you let them).
  2. Shared on-premises connectivity - one Site-to-Site VPN or Direct Connect attachment serves every VPC.
  3. Central control - which VPC may reach which is decided in the TGW route tables, not in 45 places.
  4. Centralised egress and inspection - one VPC with the NAT Gateways or firewalls for all the others.
  5. Scale - 5,000 attachments, up to 100 Gbps per VPC attachment per AZ.

Transit Gateway hub-and-spoke - VPC, VPN and peering attachments, route tables with associations and propagations, isolation of dev and prod


2. The vocabulary - attachments, TGW route tables, associations, propagations

Four terms, and routing in a TGW is simple once they click -

  1. Attachment - a connection between the TGW and something: a VPC (one subnet per AZ, the TGW puts a network interface there), a Site-to-Site VPN, a Direct Connect gateway, a peering to another TGW, or a Connect attachment (GRE/BGP to a virtual appliance).
  2. Transit gateway route table - a routing table inside the TGW - destination CIDR → attachment. A TGW has one default table and can have up to 20.
  3. Association - which TGW route table an attachment uses when traffic enters the TGW from it. Each attachment is associated with exactly one table. Think of it as "when a packet comes from VPC A, look it up in table X".
  4. Propagation - an attachment advertising its CIDRs into a TGW route table, creating routes automatically. VPC attachments propagate their VPC CIDR; VPN and Direct Connect propagate what BGP learns. You can also add static routes by hand.

By default, with Default route table association and Default route table propagation enabled, every attachment is associated with and propagates into the one default table - which means every attached VPC can reach every other. That is the quick start, and what my recording uses; isolation (section 9) means turning those defaults off and using several tables.

And the thing that trips everyone: the TGW route table gets traffic to the TGW. The VPC's own route tables still need a route towards the TGW for the destination CIDRs - two layers of routing, both required.



3. Prerequisites - three VPCs and a subnet per AZ for the attachments

In the recording I built three VPCs in Frankfurt with deliberately far-apart ranges, each with one public subnet and one Ubuntu instance running a tiny web page that prints its hostname and IP:

VPCCIDRInstancePurpose
test-vpc-112.0.0.0/1612.0.1.225the "prod" side
test-vpc-213.0.0.0/1613.0.0.221the "dev" side
test-vpc-314.0.0.0/1614.0.0.95the "shared" side

For the rest of the post I use the jhooq naming and private ranges from Part-5: jhooq-vpc 10.0.0.0/16 (prod), jhooq-dev-vpc 10.1.0.0/16, jhooq-shared-vpc 10.2.0.0/16. The steps are identical; only the numbers differ.

CIDRs must not overlap here either - a TGW route table cannot hold two identical routes to different attachments. I pre-loaded the VPC Subnet Planner with the prod VPC and the other three networks it will meet through the hub (dev, shared, and a 192.168.0.0/16 office range behind the VPN). It lays out prod's subnets and reports no overlap with any of them; change the prod address to 10.1.0.0 and the collision with dev is flagged on the diagram before you have created anything:

The planner with the prod VPC 10.0.0.0/16 and the dev, shared and office ranges as existing networks: no overlap, so every route in the hub is unambiguous

Best practice for attachments: create a dedicated small subnet per AZ (/28, 16 addresses, 11 usable) in each VPC just for the TGW network interfaces - 10.0.250.0/28 and 10.0.250.16/28 in prod, and so on. The TGW can only reach resources in AZs where it has an attachment subnet, and keeping the attachment subnets separate means their route table can stay minimal and no application ever launches into them. In the recording I used the existing public subnets, which works for a lab; the Terraform in section 13 carves the /28s.


4. Step 1 - Create the Transit Gateway

VPC → Transit gateways → Create transit gateway (getting started) -

  1. Name tag - jhooq-tgw (tg-vpc-1-vpc-2-vpc-3 in the recording). Description optional.
  2. Amazon side Autonomous System Number (ASN) - leave 64512 (private range 64512-65534; only matters for BGP over VPN/Direct Connect - make it unique if you will peer TGWs or connect several to the same on-premises router).
  3. DNS support - on (lets instances resolve public DNS names of peers to private IPs across the TGW).
  4. VPN ECMP support - on (aggregate multiple VPN tunnels).
  5. Default route table association - on; Default route table propagation - on. (We turn these off in section 9 for the isolation pattern; for the first test keep them on.)
  6. Multicast support - off. Security Group Referencing support - on if you want to reference security groups across attached VPCs (same region).
  7. Create transit gateway. State Pending → Available in a couple of minutes. A default Transit gateway route table is created with it.

The plan from the recording: three VPCs, one public subnet and one EC2 instance each, attached to a single Transit Gateway


5. Step 2 - Create the VPC attachments

Transit gateway attachments → Create transit gateway attachment (VPC attachments), three times -

  1. Name tag - tgw-att-prod. Transit gateway ID - jhooq-tgw. Attachment type - VPC.
  2. DNS support - on. IPv6 support - off. Appliance mode support - off (only for firewall/inspection VPCs, where flows must stick to one AZ).
  3. VPC ID - jhooq-vpc. Subnet IDs - tick one subnet per Availability Zone (jhooq-private-1a, jhooq-private-1b, or the dedicated /28s).
  4. Create transit gateway attachment. Repeat for tgw-att-dev (jhooq-dev-vpc) and tgw-att-shared (jhooq-shared-vpc).

This is the dialog in the recording for test-vpc-1. Note the greyed-out eu-central-1b and eu-central-1c rows: the VPC only had a subnet in 1a, so the attachment could only cover that zone.

Create transit gateway attachment: VPC test-vpc-1, one subnet per Availability Zone; 1b and 1c show No subnet available

The second attachment, tg-attachment-vpc-2, about to be created with its one subnet in eu-central-1a

Each attachment goes Pending → Available. In the EC2 → Network interfaces list you will see one new interface per selected subnet, description Network Interface for Transit Gateway Attachment tgw-attach-.... If you later add an AZ to a VPC, Modify the attachment to add a subnet there.



6. Step 3 - Add routes in each VPC towards the Transit Gateway

Now the half everyone forgets. In each VPC, in every route table whose subnets should reach the other VPCs, add a route with the TGW as target. Before the change, test-vpc-1's table had exactly the two routes every public subnet has:

rt-test-vpc-1 before: 0.0.0.0/0 to the internet gateway and 12.0.0.0/16 local, nothing towards the hub

Edit routes → Add route, destination the other VPC's CIDR, target Transit Gateway → the hub. In the recording I added the two remote ranges explicitly:

Edit routes on rt-test-vpc-1: 13.0.0.0/16 and 14.0.0.0/16 with target Transit Gateway tgw-00f76b6b5d186a784

1# rt-test-vpc-1 after the change (from the recording)
212.0.0.0/16   local
30.0.0.0/0     igw-099a983e14d178c10
413.0.0.0/16   tgw-00f76b6b5d186a784
514.0.0.0/16   tgw-00f76b6b5d186a784

The same two routes added on test-vpc-2 and test-vpc-3, each pointing the other two ranges at the hub

With private ranges the better habit is one summary route. In jhooq-private-rt: Destination 10.0.0.0/8, Target → Transit Gateway → jhooq-tgw. One route covers every 10.x VPC you will ever attach; the more specific local route for 10.0.0.0/16 still wins inside the VPC.

110.0.0.0/16   local
20.0.0.0/0     nat-...
310.0.0.0/8    tgw-0123456789abcdef0

If on-premises is 192.168.0.0/16, add that too once the VPN is attached.


7. Step 4 - The Transit Gateway route table

Open Transit gateway route tables → the default table → Routes. Because propagation is on, you already see -

110.0.0.0/16   tgw-attach-prod     propagated   active
210.1.0.0/16   tgw-attach-dev      propagated   active
310.2.0.0/16   tgw-attach-shared   propagated   active

The Associations tab shows all three attachments associated with this table, the Propagations tab shows all three propagating. That is a full mesh in three attachments - packets from any VPC that reach the TGW are looked up here and forwarded to the right attachment. Static routes can be added on the same tab (Create static route) - for example 0.0.0.0/0 → tgw-attach-shared to send all internet traffic through NAT Gateways in the shared VPC (centralised egress), or a blackhole route to drop traffic to a CIDR. The route tables page covers route priority: most specific prefix wins, then static over propagated, then VPC over Direct Connect over VPN.


8. Step 5 - Test it with EC2

Each instance in the recording serves a one-line page with its hostname and address, so curl proves the path in both directions. From test-vpc-1 to the other two, and back from test-vpc-2:

1ubuntu@ip-12-0-1-225:~$ curl 13.0.0.221
2<h1>Server Details</h1><p><strong>Hostname:</strong> ip-13-0-0-221</p><p><strong>IP Address:</strong> 13.0.0.221</p>
3ubuntu@ip-12-0-1-225:~$ curl 14.0.0.95
4<h1>Server Details</h1><p><strong>Hostname:</strong> ip-14-0-0-95</p><p><strong>IP Address:</strong> 14.0.0.95</p>
5
6ubuntu@ip-13-0-0-221:~$ curl 12.0.1.225
7<h1>Server Details</h1><p><strong>Hostname:</strong> ip-12-0-1-225</p><p><strong>IP Address:</strong> 12.0.1.225</p>

curl from the test-vpc-1 instance to the instances in test-vpc-2 and test-vpc-3, and back, all through the Transit Gateway

Security groups on the destination instances must allow the traffic from the source CIDRs (10.0.0.0/8 keeps it simple in a lab), exactly as with peering. traceroute shows one hop at the TGW network interface's address, then the target. Also handy: Route Analyzer (in Network Manager) and the Reachability Analyzer in the VPC console tell you why a path fails without a single packet.



9. Step 6 - Isolate dev from prod with separate route tables

The classic requirement - dev and prod must both reach shared services, but never each other. With TGW it is pure route table design -

  1. Create two TGW route tables - rt-spokes and rt-shared (Transit gateway route tables → Create).
  2. Associations - associate tgw-att-prod and tgw-att-dev with rt-spokes (first disassociate them from the default table - an attachment can be associated with one table). Associate tgw-att-shared with rt-shared.
  3. Propagations - into rt-spokes, propagate only tgw-att-shared → the spokes table knows just 10.2.0.0/16. Into rt-shared, propagate tgw-att-prod and tgw-att-dev → the shared table knows both spokes so replies get back.
  4. Result -
1rt-spokes (used by traffic FROM prod and dev):   10.2.0.0/16 → tgw-att-shared
2rt-shared (used by traffic FROM shared):         10.0.0.0/16 → tgw-att-prod,  10.1.0.0/16 → tgw-att-dev

Now curl to the shared instance works from prod and dev, and curl from prod to dev gets nothing - there is no route for 10.1.0.0/16 in the table prod's traffic uses. No security group needed to enforce it; the hub simply has no path. I did not build this pattern in the recording (that used the default full mesh); the Terraform in section 13 is the exact version of it and validated against the AWS provider. For new TGWs that will use this pattern, create them with default association/propagation off so nothing is reachable until you say so. The same technique builds inspection architectures (all inter-VPC traffic forced through a firewall VPC) and centralised egress (one NAT Gateway set for all VPCs - see Part-14).


10. On-premises - VPN and Direct Connect attachments

The second big win over peering. Create transit gateway attachment → Attachment type: VPN → pick or create a Customer gateway (your office router's public IP and ASN) → routing Dynamic (BGP) → create. AWS gives you two tunnels; with ECMP on, add more VPN connections to aggregate bandwidth (each tunnel is 1.25 Gbps). Routes learned via BGP propagate into the TGW route table you choose, and every VPC associated with a table that has the on-prem route can reach the office through the one VPN. For Direct Connect, attach a Direct Connect gateway the same way - up to 100 Gbps per AZ. In both cases the on-premises router learns the VPC CIDRs you allow via the TGW's BGP advertisements (filter them per attachment with route table design).


11. Transit Gateway peering across regions and sharing across accounts

Peering - a TGW is regional. To connect eu-central-1 to us-east-1, create a peering attachment from one TGW to the other (same or another account), accept it on the other side, and add static routes in both TGW route tables (peering does not propagate dynamically) - 10.100.0.0/16 → tgw-attach-peering. Traffic is encrypted on the AWS backbone, MTU 8,500 bytes, one peering per TGW pair, 50 per TGW. When you have more than two or three regions of this, Cloud WAN, Part-25 does the peering and the per-region tables for you from one policy.

Sharing - in an organization, one network account owns the TGW and shares it with AWS Resource Access Manager (RAM) to the other accounts (or the whole OU). Those accounts then create VPC attachments to the shared TGW from their own consoles; the network team accepts them (or auto-accepts) and controls the route tables. This is the standard multi-account landing zone network, and what Control Tower's network baseline builds on.



12. What it costs and the quotas

Two dimensions, with the rates from AWS's pricing feed on 2026-10-17 (the pricing page renders the same numbers):

ItemUS East (N. Virginia)EU (Frankfurt)
VPC attachment, per hour$0.05$0.06
VPN, Direct Connect gateway, peering or Connect attachment, per hour$0.05$0.06
Data processed, per GB (charged to the sending attachment)$0.02$0.02

Every attachment is billed per hour it exists, so three VPC attachments in Frankfurt are $131 a month (3 × $0.06 × 730 hours) before any traffic, and the VPC owner pays for their attachment. Peering attachments are not charged for data processing on the receiving side. Plus normal inter-AZ and inter-region data transfer. Compared with peering (free, data transfer only) this is why the rule is "peer two or three VPCs, TGW for more".

Key quotas - 5 TGWs per account per region (adjustable), 5,000 attachments per TGW, 5 TGWs per VPC, 20 route tables per TGW, 10,000 routes total, 50 peering attachments, up to 100 Gbps per VPC attachment per AZ in each direction, MTU 8,500 bytes for VPC, Direct Connect and peering traffic and 1,500 over VPN.


13. The AWS CLI and Terraform equivalents

 1TGW=$(aws ec2 create-transit-gateway --description "jhooq hub" \
 2  --options AmazonSideAsn=64512,DnsSupport=enable,VpnEcmpSupport=enable,DefaultRouteTableAssociation=enable,DefaultRouteTablePropagation=enable \
 3  --tag-specifications 'ResourceType=transit-gateway,Tags=[{Key=Name,Value=jhooq-tgw}]' \
 4  --query TransitGateway.TransitGatewayId --output text)
 5aws ec2 wait transit-gateway-available --transit-gateway-ids "$TGW" 2>/dev/null || sleep 120
 6
 7# one attachment per VPC, one subnet per AZ
 8ATT_PROD=$(aws ec2 create-transit-gateway-vpc-attachment --transit-gateway-id "$TGW" --vpc-id vpc-0prod \
 9  --subnet-ids subnet-prod-1a subnet-prod-1b --query TransitGatewayVpcAttachment.TransitGatewayAttachmentId --output text)
10# ... dev, shared
11
12# VPC side routes
13aws ec2 create-route --route-table-id rtb-prod-private --destination-cidr-block 10.0.0.0/8 --transit-gateway-id "$TGW"
14
15# isolation: custom TGW route tables
16RT_SPOKES=$(aws ec2 create-transit-gateway-route-table --transit-gateway-id "$TGW" --query TransitGatewayRouteTable.TransitGatewayRouteTableId --output text)
17aws ec2 associate-transit-gateway-route-table --transit-gateway-route-table-id "$RT_SPOKES" --transit-gateway-attachment-id "$ATT_PROD"
18aws ec2 enable-transit-gateway-route-table-propagation --transit-gateway-route-table-id "$RT_SPOKES" --transit-gateway-attachment-id "$ATT_SHARED"
19
20# inspect
21aws ec2 search-transit-gateway-routes --transit-gateway-route-table-id "$RT_SPOKES" --filters Name=state,Values=active

The isolation pattern of section 9 as Terraform, with the hub created with the defaults off, the /28 attachment subnets carved from the last /24 of each VPC, and one summary route per VPC:

 1resource "aws_ec2_transit_gateway" "hub" {
 2  amazon_side_asn                 = 64512
 3  default_route_table_association = "disable" # we decide which table each attachment uses
 4  default_route_table_propagation = "disable"
 5  dns_support                     = "enable"
 6}
 7
 8resource "aws_ec2_transit_gateway_vpc_attachment" "this" {
 9  for_each           = local.vpcs                       # dev, prod, shared
10  transit_gateway_id = aws_ec2_transit_gateway.hub.id
11  vpc_id             = aws_vpc.this[each.key].id
12  subnet_ids         = [for k, s in aws_subnet.tgw : s.id if startswith(k, "${each.key}-")]
13  transit_gateway_default_route_table_association = false
14  transit_gateway_default_route_table_propagation = false
15}
16
17resource "aws_ec2_transit_gateway_route_table" "isolated" { transit_gateway_id = aws_ec2_transit_gateway.hub.id }
18resource "aws_ec2_transit_gateway_route_table" "shared"   { transit_gateway_id = aws_ec2_transit_gateway.hub.id }
19
20# dev and prod use the isolated table, shared uses the shared table
21resource "aws_ec2_transit_gateway_route_table_association" "this" {
22  for_each                       = local.vpcs
23  transit_gateway_attachment_id  = aws_ec2_transit_gateway_vpc_attachment.this[each.key].id
24  transit_gateway_route_table_id = each.key == "shared" ? aws_ec2_transit_gateway_route_table.shared.id : aws_ec2_transit_gateway_route_table.isolated.id
25}
26
27# the isolated table learns ONLY shared's routes; the shared table learns everyone's
28resource "aws_ec2_transit_gateway_route_table_propagation" "shared_into_isolated" {
29  transit_gateway_attachment_id  = aws_ec2_transit_gateway_vpc_attachment.this["shared"].id
30  transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.isolated.id
31}
32resource "aws_ec2_transit_gateway_route_table_propagation" "all_into_shared" {
33  for_each                       = local.vpcs
34  transit_gateway_attachment_id  = aws_ec2_transit_gateway_vpc_attachment.this[each.key].id
35  transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.shared.id
36}
37
38# the return route inside each VPC
39resource "aws_route" "to_tgw" {
40  for_each               = local.vpcs
41  route_table_id         = aws_route_table.private[each.key].id
42  destination_cidr_block = "10.0.0.0/8"
43  transit_gateway_id     = aws_ec2_transit_gateway.hub.id
44}

Validated and planned on 2026-10-17 with Terraform 1.16.2 and AWS provider 6.69.1 (mock credentials, nothing created):

 1$ terraform validate
 2Success! The configuration is valid.
 3
 4$ terraform plan
 5  # aws_ec2_transit_gateway.hub will be created
 6  # aws_ec2_transit_gateway_route_table.isolated will be created
 7  # aws_ec2_transit_gateway_route_table.shared will be created
 8  # aws_ec2_transit_gateway_route_table_association.this["dev"] will be created
 9  # aws_ec2_transit_gateway_route_table_propagation.shared_into_isolated will be created
10  # aws_ec2_transit_gateway_vpc_attachment.this["prod"] will be created
11  # aws_subnet.tgw["prod-0"] will be created
12  ...
13Plan: 28 to add, 0 to change, 0 to destroy.
14
15Outputs:
16attachment_subnets = {
17  "dev-0"    = "10.0.250.0/28"
18  "dev-1"    = "10.0.250.16/28"
19  "prod-0"   = "10.1.250.0/28"
20  "prod-1"   = "10.1.250.16/28"
21  "shared-0" = "10.2.250.0/28"
22  "shared-1" = "10.2.250.16/28"
23}

The /28s come from cidrsubnet(cidrsubnet(vpc_cidr, 8, 250), 4, az_index), the same arithmetic the planner prints for every subnet it lays out. For the multi-account pattern add aws_ram_resource_share with provider aliases as in Terraform and AWS multi-account setup; the resources are documented at aws_ec2_transit_gateway and aws_ec2_transit_gateway_vpc_attachment.


14. Common Transit Gateway errors and how to fix them

1. Attachments are Available but ping fails - The VPC-side route towards the TGW is missing (section 6) - this is error number one. Then: the destination VPC's route table also needs its route back; then security groups/NACLs; then check the TGW route table associated with the source attachment actually contains the destination CIDR.

2. One AZ works, another does not - The attachment has no subnet in that AZ. Modify the attachment and add a subnet in the AZ where the instance lives. In my recording every attachment had a single subnet in eu-central-1a, which is exactly the setup that produces this error the day an instance lands in 1b.

3. Route already exists / cannot add a route in the TGW table - A propagated route for the same CIDR exists (overlapping VPC CIDRs). A static route to a different attachment overrides a propagated one only if it is more specific or you remove the propagation.

4. IncorrectState: ... is not in a valid state on associate - The attachment is still pending, or is already associated with another table - disassociate first (one association per attachment).

5. TransitGatewayLimitExceeded - 5 per account per region. Delete lab TGWs or request an increase.

6. The VPN attachment shows DOWN - Tunnel configuration on the customer gateway (pre-shared key, IKE version, BGP ASN) - download the configuration file for your router model from the VPN connection page.

7. Traffic to the internet from a spoke fails after centralising egress - The 0.0.0.0/0 → shared attachment static route is in the spokes table, but the shared VPC's private route table for the attachment subnets has no 0.0.0.0/0 → nat-..., or the NAT's public route table lacks the return routes to the spoke CIDRs (10.0.0.0/8 → tgw). Both layers again.

8. Cross-account attachment stays pendingAcceptance - The TGW owner must accept it (or enable auto-accept on the TGW), and the TGW must be shared via RAM with that account first.

9. Peering routes do not appear - Peering attachments do not propagate - add static routes in both TGWs' tables.

10. Big bill with little traffic - Attachment-hours. Count your attachments (including the forgotten ones in deleted projects) and remove what you do not need.


15. What broke when I ran this

The console build and the curl tests are from my recording of 26 October 2023 in Frankfurt; the Terraform, prices and quotas are from 2026-10-17.

1. Two of three Availability Zones were greyed out on every attachment. Each lab VPC had one subnet, so the attachment dialog showed No subnet available for eu-central-1b and 1c. The attachments worked because the instances were also in 1a. Had I launched an instance in 1b, it would have had no path to the hub and the symptom would have been error 2 above, with everything showing Available. One subnet per AZ in every attachment is the rule.

2. The route editor rejected 13.0 and left the target dropdown empty. Typing a partial destination gave A valid CIDR block or a prefix list has to be specified, and until the destination is valid you cannot pick a target, so for a moment it looks like Transit Gateway is missing from the list. It is the same editor quirk I hit in Cloud WAN; type the full 13.0.0.0/16 first.

3. Six route edits for three VPCs. With explicit remote routes, every VPC route table got two entries, and a fourth VPC would mean editing all three again plus three on the new one. The 10.0.0.0/8 summary route the Terraform uses is one entry per VPC for ever; the only reason the recording used explicit routes is that 12, 13 and 14.0.0.0/16 have no common summary that excludes the internet.

4. The default settings gave me a full mesh I did not want. With default association and propagation on, dev could reach prod the moment both were attached. That is fine for a demo and wrong for the dev/prod/shared requirement, and undoing it means disassociating attachments one by one. The Terraform creates the hub with both defaults disabled, which is the setting I would recommend for anything beyond a lab.


16. Conclusion

To summarise Part-13 -

  1. A Transit Gateway is a regional hub router: attach each VPC, VPN, Direct Connect gateway or peer TGW once, and the hub forwards between them - transitive, scalable, centrally controlled.
  2. Routing has two layers - every VPC route table needs a route towards the TGW (a 10.0.0.0/8 summary works), and the TGW route tables decide where traffic goes next.
  3. Associations say which TGW table an attachment's incoming traffic uses; propagations fill tables with attachment CIDRs automatically; static routes handle peering, egress and blackholes.
  4. Isolation is table design - spokes in one table that only sees shared services, shared services in another that sees the spokes; the same pattern gives centralised egress and inspection.
  5. It costs per attachment-hour ($0.05 to $0.06) and per GB ($0.02) - so peer two or three VPCs, and use a TGW for many VPCs, shared on-premises links or central control.

The official references are the Transit Gateway guide, how transit gateways work, route tables and quotas. Next, the component every private subnet depends on gets its own deep dive - NAT Gateway, Part-14.


Did this save you a debugging session? Stay in the loop -

AWS step by step series -

  1. Part-1 : AWS IAM user - create a user, group, policy, access keys and MFA
  2. Part-2 : AWS Organizations - multi-account setup, OUs and SCPs
  3. Part-3 : AWS assume IAM role - trust policy, switch role in console and CLI
  4. Part-4 : How to launch an EC2 instance - key pair, security group, SSH
  5. Part-5 : AWS VPC - public and private subnets, Internet Gateway, NAT Gateway, route tables
  6. Part-8 : EC2 launch template - versions, default version, source template, SSM parameter AMI
  7. Part-10 : EC2 Auto Scaling - launch template, Auto Scaling group, target tracking, ALB
  8. Part-11 : AWS WAF - web ACL, managed rules, rate limiting, geo blocking
  9. Part-12 : AWS VPC Peering - connect two VPCs, routes, security groups, DNS
  10. Part-13 : AWS Transit Gateway - hub-and-spoke for many VPCs and on-premises
  11. Part-14 : AWS NAT Gateway deep dive - public vs private, limits, cost, troubleshooting
  12. Part-15 : Amazon Route 53 - hosted zones, records, alias, routing policies, health checks
  13. Part-16 : AWS security groups - inbound and outbound rules, stateful, referencing, quotas
  14. Part-16 : AWS Certificate Manager - free TLS certificates for ALB, CloudFront and API Gateway
  15. Part-17 : AWS Lambda - function URLs, environment variables and layers
  16. Part-18 : Network Load Balancer - setup, and ALB vs NLB
  17. Part-19 : VPC endpoints - gateway and interface endpoints (PrivateLink) instead of NAT
  18. Part-20 : AWS PrivateLink - publish your own service with an endpoint service and NLB
  19. Part-20 : Amazon EBS volumes - types, attach, mount, resize, snapshots, encryption
  20. Part-21 : VPC Flow Logs - CloudWatch Logs, S3, record format, Logs Insights, Athena
  21. Part-21 : EC2 Spot Instances - pricing, interruptions, mixed instances groups
  22. Part-23 : AWS Global Accelerator - static anycast IPs in front of ALBs in two regions, traffic dials, weights
  23. Part-24 : AWS Control Tower - landing zone, controls, Account Factory, Identity Center
  24. Part-25 : AWS Cloud WAN - global network, core network policy, dev/prod/shared segments, tag-based attachments across three regions

Networking fundamentals -

  1. What is a VPC and a subnet? AWS networking in five minutes
  2. What is CIDR? Calculate IP ranges for VPCs and subnets
  3. VPC Subnet Planner - the free tool I use to size the VPC and subnet CIDRs in every part of this series (AWS, Azure, GCP rules built in)
  4. What is NAT? Static NAT, dynamic NAT and PAT explained

More AWS guides -

  1. What is AWS CloudFormation? Templates, stacks, change sets, drift, StackSets
  2. Learn AWS S3 - the complete course
  3. AWS API Gateway - REST API with Lambda, authorizers, Terraform
  4. AWS Advanced Networking Specialty (ANS-C01) - course companion
  5. AWS ECS and Fargate - how to deploy a Docker container
  6. AWS S3 - how to host a static website
  7. Terraform create EC2 instance on AWS
  8. Terraform AWS IAM - users, roles and policies
  9. Terraform and AWS multi-account setup
  10. Terraform - setting up an ALB and SSL