Repository navigation
feat(network): single-VPC foundation stack (ADR 0001 step 2, ground#10) - #25
Merged
Merged
Conversation
Build step 2 of docs/adr/0001-network-foundation.md: the TransitGateway:false single-VPC template the hub-and-spoke expansion (step 3) builds on. - network.Stack.Template(): private-only VPC (no IGW) on the deterministic hub /16; one private /20 subnet per AZ (3 default, region-portable via Fn::GetAZs); gateway VPC endpoints for S3/DynamoDB (route-table, no hourly cost); interface endpoints for the rest of NetworkConfig.VPCEndpoints, each with an org-conditioned policy (allow same-org aws:PrincipalOrgID vs a deploy-time OrgId param, deny external — mirrors policies/vpc_endpoint_policy.json; OrgId resolved like the accounts stack's OrgRootId). - New(cfg, org): org supplies region (endpoint service names are region-qualified) + the org-id anchor. Wired into ground deploy --dry-run. - Built as cfn.Template (Go maps -> JSON -> CloudFormation SDK) like the other four stacks. Native CloudFormation is ground's deploy path; CDK stays an optional --output cdk export, not a per-stack dependency. - template-as-data tests: VPC CIDR (hub /16), private subnets + no-IGW, gateway-vs- interface split, org-scoped policy (Ref OrgId, Allow+Deny), determinism, default CIDR, OrgId param, outputs. Live-deploy numbered-phase wiring + hub-and-spoke/TGW (step 3) are follow-ups. Refs: #11, #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build step 2 of ground's network foundation (
docs/adr/0001-network-foundation.md) — theTransitGateway:falsesingle-VPC template that delivers the long-promised foundation and is the base the hub-and-spoke expansion (step 3) builds on.On the CDK question
ground's deploy path is native CloudFormation: every stack builds a
cfn.Template(Go maps) → JSON → CloudFormation SDK (internal/deploy). CDK exists only as an optionalground deploy --output cdkexport artifact (internal/iac), and that generator is deliberately partial. Building the network stack in CDK would pull the jsii/aws-cdk-go toolchain intogo.modand diverge from all four existing stacks for no deploy benefit — so this follows the establishedcfn.Templatepattern. CDK stays available as an export, not a per-stack dependency.What
network.Stack.Template()emitsFn::GetAZs.NetworkConfig.VPCEndpoints(ENIs in every subnet, private DNS).aws:PrincipalOrgIDagainst a deploy-timeOrgIdparameter, deny external — mirrorspolicies/vpc_endpoint_policy.json;OrgIdis resolved like the accounts stack'sOrgRootId.Tested
Template-as-data unit tests (pure, no AWS): VPC CIDR = hub /16, private subnets + no IGW, gateway-vs-interface split, org-scoped policy (
Ref OrgId, both Allow and Deny), determinism, default-CIDR, OrgId parameter, outputs. Verified the--dry-runemits valid region-qualified CloudFormation. Full ground suite: 0 failures.Honest scope
--dry-runonly. The existing deploy loop hardcodes phase numbering ([1/2]…[4/4]); cleanly adding a 5th phase to that brittle orchestration is its own focused change, not bundled into the template PR.Refs: #11, #10.