Repository navigation
feat(iac-aws): tier aliases and roles for SharedVpc renames - #75
Merged
Merged
Conversation
A subnet tier can be renamed without replacing anything, carry the role of the workloads it holds, and name the accounts it is shared with. Implements Bh.Flow.Platform.NetworkDualStack 8 @ f03b8f21 (SubnetTier role, shareWith, formerNames; Subnet azId). - formerNames: every resource SharedVpc names after a tier (subnets, the tier NACL and its rules and associations, route tables, routes and route-table associations, RAM associations) carries each former logical name as a Pulumi alias. The standard outputs and NAT placement follow a renamed tier through its former name; tierSubnetIds lists tiers by current name. - role: tagged Role on subnets and NACLs. Optional this release (a warning), required after. - shareWith: the accounts a tier is shared with, by sharedAccounts name. The full set uses the main share, a narrower set gets its own share, [] shares with none. shareViaRam is deprecated; exactly one of the two, and unknown accounts fail closed. - RAM associations are now named by tier and AZ letter; the old running-index name rides along as an alias. legacyRamSharedTiers gives the old layout for a stack that changes its sharing in the same apply. - AzId tag on every subnet (zone names differ per account), from availabilityZoneIds or aws.getAvailabilityZones. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 of 2 tasks
lloydmangnall
added a commit
that referenced
this pull request
Oct 25, 2026
Implements Bh.Flow.Platform.NetworkDualStack 9 (SubnetTier: role and shareWith required, replacing shareViaRam), ending the one-release deprecation that #75 (0.5.1) opened. - SubnetTier.role and SubnetTier.shareWith are required. validateTierSharing refuses a tier without a role, without shareWith, or still setting shareViaRam, and names the replacement: shareViaRam true is every account in sharedAccounts, false is []. - The main share holds the tiers whose shareWith names every account in sharedAccounts (isInMainShare), as shareViaRam: true did. legacyRamAssociationNames derives a stack's pre-0.6.0 association names from those tiers, so a stack that moves shareViaRam: true to shareWith every account keeps every association with no legacyRamSharedTiers. - DEFAULT_SUBNET_TIERS is now defaultSubnetTiers(sharedAccounts): public in the owner account, private and data shared with every account. tierShareTargets takes the tier only. - The shared route table's SharedByTiers tag joins tier names with "+", not ",", which the tag-charset rule flags. The live tag (e.g. "private,data") updates in place. BREAKING CHANGE: a SubnetTier without role or shareWith, or with shareViaRam, is refused. With no sharedAccounts, the default private and data tiers are no longer associated with the main share (sharing with no principal shared nothing). Consumers: iac-worx dev-ops-vpc-usw2, stg-ops-vpc-use1, stg-ops-vpc-usw2 and prd-ops-vpc-use1 still set shareViaRam. dev-ops-vpc-use1 already uses role and shareWith (#151). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Lets a SharedVpc tier be renamed without replacing anything, carry the role of the workloads it holds, and name the accounts it is shared with.
Implements:
Bh.Flow.Platform.NetworkDualStack8 @ f03b8f21 (SubnetTierrole,shareWith,formerNames; SubnetazId; invariantsrename-keeps-identity,shared-only-with-the-role-accounts,zones-named-by-id,tier-has-a-role).What changes
formerNames: every resource SharedVpc names after a tier carries each former logical name as a Pulumi alias: subnets, the tier NACL, its rules and associations, route tables, routes, route-table associations and RAM associations.publicSubnetIds/privateSubnetIds/dataSubnetIdsand NAT placement follow a renamed tier through its former name. New outputtierSubnetIdslists every tier by its current name.role: taggedRoleon the tier's subnets and NACL. Optional in this release (a warning when absent), required after.shareWith: the accounts (bysharedAccountsname) a tier is shared with. The full set goes in the main share, a narrower set gets a share of its own, and[]shares with no account.shareViaRamis deprecated but still accepted. Exactly one of the two is required, and an unknown account fails closed.<env>-ram-<tier>-<n>) to tier plus AZ letter (<env>-ram-<tier>-<a…p>), carrying the old name as an alias.legacyRamSharedTiersgives the old layout for a stack that changes its sharing in the same apply.AzIdtag on every subnet (zone names map to physical zones per account), fromavailabilityZoneIdsoraws.getAvailabilityZones.Tests
shared-vpc.rename.unit.test.ts(17 new tests) runs the old and new layouts and checks what the engine would do, using the aliases from the child options.formerNamesand unchanged sharing: no creates, no deletes.legacyRamSharedTiers: only the unshared tiers' associations are deleted.formerNames: everything is replaced.Also covered: outputs follow the rename; the
RoleandAzIdtags; a narrower share; and the fail-closed sharing checks. The existing mocks now answergetAvailabilityZones.nx run-many -t lint typecheck test build -p @adaptiveworx/iac-awspasses: 80 tests, up from 63.Depends on: nothing.
Followed by:
dev-ops-vpc-use1: the rename (public→edge, private→flow, data→analytics) with roles,shareWith(flow: worx-app-dev; edge and analytics: none),legacyRamSharedTiers: ["public", "private", "data"], and the stack'sparseSubnetTierskeys (role, shareWith, formerNames).app-flow-use1, which reads the flow tier's /64s.Apply steps: none for this PR. The EA publishes the release via Nx Release; the version is not hand-edited.
Expected preview for the consumer (dev-ops-vpc-use1, once it adopts this):
Name,Tier,RoleandAzId.Out of scope, noted: the repo README,
docs/security-implementation.mdandiac-schemas' infisical-secrets example still showshareViaRam. It's still valid; docs follow-up.🤖 Generated with Claude Code