jajera · tgw-policy-based-routing-walkthrough

TGW Policy-Based Routing

Published walkthrough for the jajera/tgw-policy-based-routing lab — a three-account hub-and-spoke demo that proves destination-only Transit Gateway routing versus Policy-Based Routing (same Spoke B IP, TCP/443 via Hub, TCP/80 direct).

Three accounts

What this covers

The pattern. Classic transit gateway route tables forward by destination prefix only. A policy table evaluates an ordered rule set (source/destination CIDR, protocol, ports) and selects a target route table — first match wins; no match is implicit deny. Destination routing still runs inside the table PBR selects.

The lab. Terraform in jajera/tgw-policy-based-routing provisions the topology. This site is the operator walkthrough and concept docs — clone and apply the lab, then follow Deploy and prove.

Lab rule 100 matches destination TCP/443 → Steer via Hub. Rule 200 is a catch-all → Direct. Without the catch-all, :80 and ICMP drop (implicit deny).

Read in this order

Last verified against AWS Transit Gateway documentation on 2026-08-06. Feature availability, limits, and behaviour can change — check current AWS docs before relying on any claim here.

Prerequisites in brief

  • Terraform >= 1.6 and AWS provider >= 5.0 (in the lab repo)
  • Profiles network, sandbox, and shared-services (three distinct accounts)
  • Session Manager plugin
  • Region examples: ap-southeast-2

Full detail in the walkthrough.

The lab is billable while running: TGW attachments, NAT, EC2, flow logs. Follow teardown in the walkthrough; confirm terraform state list is empty.


Next: Architecture →


Back to top

Walkthrough for jajera/tgw-policy-based-routing. AWS feature availability, limits, and behaviour can change — verify against current AWS documentation before relying on any claim here.

TGW PBR lab walkthrough