In an AWS Transit Gateway, what is the difference between associating an attachment with a route table and propagating that attachment's routes into one, and how do you use both to keep dev and prod isolated while both reach shared services?
answer
- one is ingress, the other is advertising
- associate once, propagate many times
- isolation is a missing route
- the default table quietly flattens everything
- static beats propagated for the same prefix
basics
~20 sAssociation picks the one route table a Transit Gateway consults for traffic arriving from an attachment; propagation copies that attachment's routes into any route tables you choose. Segmentation comes from giving dev and prod separate route tables that propagate shared services but never each other.
solid answer
~50 sThey are two different directions. **Association** answers "when a packet enters the gateway from this attachment, which route table do we look in?" — an attachment associates with exactly one table. **Propagation** answers "which route tables learn the prefixes behind this attachment?" — an attachment can propagate into many. Segmentation falls out of combining them: create a prod route table and a dev route table, associate prod VPC attachments with the first and dev with the second, and propagate the shared-services attachment into both while never propagating dev into the prod table or vice versa. Dev and prod hang off the same gateway and simply have no route to each other, so isolation is enforced by the absence of a route rather than by a filter. The trap is the default configuration: leave automatic association and propagation on and every attachment lands in one table with any-to-any reachability — usually before anyone intended it.
code
bash · 14 lines# ingress: which table the gateway consults for traffic FROM this attachment
aws ec2 associate-transit-gateway-route-table \
--transit-gateway-route-table-id tgw-rtb-0prod1111 \
--transit-gateway-attachment-id tgw-attach-0app2222
# advertising: let the shared-services VPC be learned by the prod table
aws ec2 enable-transit-gateway-route-table-propagation \
--transit-gateway-route-table-id tgw-rtb-0prod1111 \
--transit-gateway-attachment-id tgw-attach-0shared3333
# deliberate drop, distinguishable from a route someone forgot
aws ec2 create-transit-gateway-route \
--transit-gateway-route-table-id tgw-rtb-0prod1111 \
--destination-cidr-block 10.90.0.0/16 --blackholego deeper
Know that a Transit Gateway has its own route tables and that a VPC being attached does not by itself mean it can reach the other attachments.
State the distinction cleanly — an attachment associates with exactly one route table, which is consulted for traffic entering from it, and propagates its routes into as many tables as you choose.
Build the pattern out loud: separate prod, dev and shared-services route tables, propagations that never cross environments, blackhole routes for deliberate drops, and appliance mode when a stateful inspection VPC sits in the path.
Own segmentation as policy — which boundaries the route tables encode, why absence of a route is a stronger control than a deny rule, and how the network account keeps association and propagation authority while application accounts attach their own VPCs.
## Two knobs that sound alike A Transit Gateway holds one or more route tables, and every attachment relates to them in two independent ways. **Association — ingress.** Each attachment is associated with exactly **one** Transit Gateway route table. When a packet enters the gateway from that attachment, that table decides where it goes. "Which routes does this attachment *see*?" **Propagation — advertising.** An attachment's own prefixes — a VPC's CIDRs, or the prefixes learned by BGP over a VPN or Direct Connect gateway attachment — can be propagated into **any number** of route tables. "Who *learns about* this attachment?" The two are independent. An attachment can be associated with table X while propagating into tables X, Y and Z, and it can propagate into tables it is not associated with at all. That asymmetry is exactly what makes one-way patterns possible. ## The segmentation pattern The canonical layout for a shared hub: - **Prod route table** — prod VPC attachments associated with it. Propagations: prod attachments and the shared-services attachment. No dev. - **Dev route table** — dev VPC attachments associated with it. Propagations: dev attachments and the shared-services attachment. No prod. - **Shared-services route table** — the shared-services VPC attachment associated with it. Propagations: prod, dev and shared services, so shared services can answer both. A dev instance sending traffic to a prod address hits the dev route table, finds no matching route, and the packet is dropped inside the gateway. There is no rule to misconfigure and no policy engine to evaluate — the isolation is the *absence* of a route, which is a much stronger property than a deny rule someone can edit. When you need to prove a prefix is deliberately dropped rather than accidentally missing, add a **blackhole** route for it. That is also how you quarantine a range without detaching anything. ## Static routes and precedence Besides propagated routes, you can add static routes to a Transit Gateway route table pointing at a specific attachment. Static routes take precedence over propagated ones for the same destination, which is how you steer traffic through an inspection VPC: propagate normally, then add a static route for the destination range pointing at the firewall attachment. For stateful appliances, enable **appliance mode** on the inspection VPC's attachment. Without it, forward and return traffic can land in different Availability Zones and reach different appliance instances, and a stateful firewall drops the half of the flow it has no state for. Appliance mode keeps a flow pinned to the same AZ for both directions. This is a genuinely common production failure and it is worth naming. ## The default that quietly undoes all of it A Transit Gateway is created with automatic association and automatic propagation enabled and a default route table. Every new attachment then associates with that one table and propagates into it, and you have a flat any-to-any network wearing the costume of a segmented one. If you intend to segment, turn both defaults off at creation and make every attachment's association and propagation an explicit act. This is also the answer to "is a Transit Gateway transitive?" — yes, but only where its route tables say so. Transitivity is a capability, not a promise. ## Operating it Attachments frequently belong to other accounts, since the gateway is shared through AWS Resource Access Manager. Note the split: the attachment is created by the VPC's owner, but **association and propagation are controlled by the gateway's owner**. That is precisely the boundary you want — application teams attach their own VPCs, and the network account decides who talks to whom. For debugging, `SearchTransitGatewayRoutes` shows what a given route table actually holds, including blackholes, and Network Manager gives a topology view. The most common finding is not a broken route but a missing propagation on one of the two tables involved in a bidirectional path. ## What interviewers listen for The clean one-line distinction — association is ingress, propagation is advertising — followed by the three-table pattern and the observation that isolation comes from a missing route rather than a deny. Mentioning the automatic-association default, or appliance mode for stateful inspection, is what makes it sound like something you have operated instead of read.
- What is the risk of leaving a Transit Gateway's default route table settings in place?Automatic association and automatic propagation put every new attachment into a single default route table, so each VPC learns every other VPC's prefixes and the hub becomes flat any-to-any. Turn both off at creation if you intend to segment, so association and propagation are explicit decisions rather than side effects of attaching.
- How do you force east-west traffic through a firewall appliance without breaking it?Add static routes in the Transit Gateway route tables pointing the destination prefixes at the inspection VPC's attachment — static routes win over propagated ones — and enable appliance mode on that attachment. Without appliance mode, forward and return traffic can hit different Availability Zones and a stateful appliance drops the flow it lacks state for.
- Who controls association and propagation when a VPC in another account attaches to a shared gateway?The gateway's owner. The VPC owner creates the attachment, but the account that owns the Transit Gateway decides which route table it associates with and which tables its routes propagate into. That split keeps routing policy in a central network account while application teams still attach their own VPCs.
saying these in an interview costs you the question
- An attachment can be associated with several route tables at once
- Propagation and association are two names for the same setting
- Attaching a VPC to the gateway makes it reachable from every other VPC
- Propagated routes take precedence over static routes
- Segmentation needs deny rules in the Transit Gateway route table