feat(bootstrap): resource-action-map for synth-time validation#165
feat(bootstrap): resource-action-map for synth-time validation#165scottschreckengaust wants to merge 8 commits into
Conversation
d31fd4d to
d3a9804
Compare
Note: this branch currently sits on top of feat/bootstrap-template (#162). When #162 merges to main, I'll retarget and rebase per ADR-001 §8 — the scaffold commit |
ed0cf6b to
ab01560
Compare
d42d870 to
c5b7401
Compare
8a27b84 to
5bc41d6
Compare
5bc41d6 to
c55756d
Compare
Replace comment toggle with proper context gate. ECS resources only synthesize when compute_type=ecs is passed. Default (agentcore) behavior unchanged. Closes #164 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…are policy selection Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Maps all CloudFormation resource types used by the ABCA stack to their required IAM actions per lifecycle phase (create/read/update/delete). Actions are sourced from CloudTrail-validated policies in DEPLOYMENT_ROLES.md. Tests validate structure, format, and policy coverage (with known gaps for SQS, S3 bucket lifecycle, and Lambda ESM/Layer actions documented). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Validates that all resource types in the synthesized CloudFormation template have entries in the resource-action-map. Tests agentcore from existing cdk.out and attempts ECS synth gracefully skipping when AWS credentials are unavailable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
compute_type drives which compute policy is needed — agentcore and ecs are independent choices, not base+optional. An operator deploying only ECS should not require agentcore permissions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The resource-action-map test previously synthesized into cdk/cdk.out.ecs/ inside the repo tree. CDK's AgentRuntimeArtifact.fromAsset(repoRoot) fingerprints the entire tree, so when github-tags.test runs in parallel it can stat synth.lock mid-lifecycle and hit ENOENT. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a3fcb8f to
684817e
Compare
|
on it |
Review —
|
Summary
Closes #124
Closes #164
Creates a mapping from CloudFormation resource types to required IAM actions (CRUD lifecycle), scoped to all resource types in this app's synthesized template. Introduces
getRequiredBootstrapPolicies()for downstream consumption by the Aspect (#125) and preflight validator (#126). Gates ECS construct oncompute_typecontext variable (replaces comment toggle).Stack position
PR 5 for #120 — least-privilege CDK bootstrap policies as code
Prior: Custom template generator + compute variants (PR #162, #123)
This PR: Resource-action-map + ECS context gate + required-policies module
Next: CDK Aspect for policy envelope checking (#125)
Key decisions
Deliverables
Test plan
Open questions
Implementation plan
See: docs/superpowers/plans/2026-05-21-resource-action-map.md
Blocked by: #123 (PR #162)
References: RFC #120, ADR-002
🤖 Generated with Claude Code