Menu

1 / 5

Segmenting AWS Accounts with Transit Gateway Route Tables (Terraform + Diagrams)

DEV Community: terraform·Chikara Inohara·3 days ago
#iqYvqK0X
#devtoterraform#devto#dev#prod#shared
Long article (2145 words) — no AI summary yet.
Reading 0:00
15s threshold

Lately I've been reviewing network paths between accounts in a multi-account AWS setup. Transit Gateway (TGW) makes connecting VPCs easy — but with the default settings, every attached VPC can reach every other one , which is not what you want from a data-leak point of view.

In this post I lay out, in Terraform and diagrams, a TGW route-table design where prod and dev can't talk to each other, but both can reach shared services :

the difference between association and propagation

why you should turn the defaults off

blackhole routes as a safety net against mistakes

a tiny checker that builds a reachability matrix straight from the Terraform code

The screenshots are real runs on my Linux box — but they are static analysis of the Terraform code , not results from an applied AWS environment (CIDRs and IDs are dummies).

Target design

from \ to prod dev shared

prod - NG OK

dev NG - OK

shared OK OK -

Terminology: association vs.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.