Skip to content

feat(network): hub-and-spoke + segregated Transit Gateway (ADR 0001 step 3) - #26

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/network-hub-spoke
Jun 13, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/network-hub-spoke

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Build step 3 of ground's network foundation (docs/adr/0001-network-foundation.md) — the topology where tier isolation stops being just a tag and becomes a routing fact.

What

When network.transit_gateway is set and org.workload_ous lists tiers, Template() builds:

  • a shared hub VPC holding the centralized gateway + org-conditioned interface endpoints (cost: one set shared via TGW, not per-spoke),
  • one private spoke VPC per workload tier,
  • a Transit Gateway with segregated per-tier route tables.

The isolation invariant

Each spoke's TGW route table has a route to the hub (so it can reach the shared endpoints) and none to any sibling spoke — so a SensitiveResearch spoke physically cannot route to a Research spoke. The TGW also disables default route-table association/propagation, so a newly-attached VPC can't silently join a shared table and defeat the segregation. TestHubSpoke_NoCrossSpokeRoutes asserts no spoke route table ever points at a sibling's CIDR.

Structure

  • singleVPCTemplate (step 2) is unchanged and remains the degrade path; Template() dispatches on config (TGW off or no tiers → single VPC). TestHubSpoke_DegradesWithoutTiers covers it.
  • Spoke tiers come from org.WorkloadOUs — config-driven, deterministic via the step-1 CIDR allocator.
  • Helpers: addVPC / addTGWAttachment / tgwRouteTable / tgwAssociation.

Tested (template-as-data, no AWS)

Topology shape (hub + 3 spokes = 4 VPCs, 4 attachments, 4 segregated route tables, no IGW), the no-cross-spoke-route invariant, default-table-disable guard, endpoints-only-on-hub, determinism, and degrade-without-tiers. Verified ground deploy --dry-run renders the hub-and-spoke CloudFormation (1 TGW, 6 TGW routes = 3 hub→spoke + 3 spoke→hub, 3 endpoints on the hub). Full ground suite: 0 failures.

Remaining

Step 4 — compute-to-data egress per DataEndpoint (the ground#10 routing). And the live numbered-deploy-phase wiring (dry-run only today) is still a follow-up.

Refs: #11, #10.

…tep 3)

Build step 3 of docs/adr/0001-network-foundation.md: the topology where tier
isolation becomes a routing fact.

When network.transit_gateway is set and org.workload_ous lists tiers, Template()
builds a shared hub VPC (centralized gateway + org-conditioned interface
endpoints), one private spoke VPC per tier, and a Transit Gateway joining them
with SEGREGATED per-tier route tables: a spoke's TGW route table routes to the hub
(for shared endpoints) but NOT to sibling spokes — cross-tier traffic has no path.
The TGW disables default route-table association/propagation so a new attachment
can't silently join a shared table and defeat the isolation.

- singleVPCTemplate (step 2) unchanged + still the degrade path (TGW off or no
  tiers); Template() dispatches on config.
- addVPC/addTGWAttachment/tgwRouteTable/tgwAssociation helpers; spoke tiers from
  org.WorkloadOUs (config-driven, deterministic via the step-1 allocator).
- tests: topology shape (hub+3 spokes, 4 attachments, 4 route tables, no IGW),
  default-table-disable guard, EndpointsOnlyOnHub, Deterministic, degrade-without-
  tiers, and the load-bearing NoCrossSpokeRoutes invariant.

Endpoints centralize on the hub (shared via TGW) — cost decision per the ADR.
Verified via ground deploy --dry-run.

Refs: #11, #10
@scttfrdmn
scttfrdmn merged commit 9777656 into main Jun 13, 2026
2 checks passed
@scttfrdmn
scttfrdmn deleted the feat/network-hub-spoke branch June 13, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant