You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Q3 Option D — scope-intersection preflight (§1.108) (#38)
Prevents cross-Lambda MPE contamination (§1.108) at deploy time by computing
scope overlap against every existing map-auto-tagger-* stack in the target
account. Hard-fails the deploy with a named peer + named overlap element so
the customer knows exactly which stack conflicts and on which dimension.
Q3 Option D rules (decided 2026-04-24 after reviewing Options A/B/C):
account/ALL vs anything in same account → conflict (ALL dominates)
account/[X,Y,…] vs account/[Z,Y,…] → conflict iff shared account ID
account/[X,Y,…] vs vpc/[V,…] → conflict iff deploy-account ∈ [X,Y,…]
vpc/[V1,V2] vs vpc/[V2,V3] → conflict iff shared VPC ID
vpc/[V1,…] vs vpc/[Vn,…] (disjoint) → safe coexistence
Two-phase preflight:
1. IAM (extends PR #23 batched SimulatePrincipalPolicy):
- single-account path: adds cloudformation:ListStacks, ssm:GetParameter
- multi-account path: adds cloudformation:ListStacks, ListStackSets,
ListStackInstances, organizations:ListAccounts, ssm:GetParameter
Fail-fast with precise missing-permission error before running any
subsequent check. Per user decision 2026-04-24, unreadable peer config
(missing ssm:GetParameter) now hard-fails with the specific remediation
instead of the prior "treat as full conflict" fallback.
2. Scope-intersection (replaces PR #24's Class-2 account/account-too-strict
logic): reads each peer stack's SSM config, classifies the overlap per
the rules table, fails with the specific overlap dimension.
Out of scope (per Q3 Option D scope decisions 2026-04-24):
- TOCTOU on simultaneous deploys (rare; accepted)
- Manual SSM edits post-deploy (users deploy only via configurator per policy)
- Bypass-configurator deploy paths (unsupported by policy)
Reuses PR #24 Class-1 (multi-account StackSet) preflight scaffolding — Class-1
already computes account-set intersection correctly, so no change there.
Blocks reconciliation Lambda (plan-PR #39) per Q2-4 ordering decision. Landing
this before reconciliation makes wrong-MPE overwrite safe-by-construction for
new deploys (no overlapping peer tagger can exist going forward).
Verified locally: sync-check passes, lint_event_prefixes passes, 117-line
configurator.html change net +39. Deploy-script paths are inline JS template
literals; shell syntax tested via render.
Co-authored-by: Chris Hyu <chhyu@amazon.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments