feat(bootstrap): policies as typed TypeScript with version and hash#158
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…t from code Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
#126 — has a detailed implementation note explaining the version-bump enforcement gap and how the preflight validator should close it. Summary of the artifact management lifecycle: Developer changes policy TS The version-bump itself remains a developer responsibility (enforced by review convention now, deploy-time gate in #126 later). The files exist to give the combination of two tests:
The chain is: TypeScript policies (source of truth) If any link breaks — TypeScript changes, JSON stale, hash stale — the test fails. The golden-baseline test separately verifies the TypeScript matches DEPLOYMENT_ROLES.md, closing the full loop from documentation → code → artifacts → hash. |
Summary
Closes #122
Ports the three IaCRole-ABCA IAM policies from
docs/design/DEPLOYMENT_ROLES.mdinto typedTypeScript modules at
cdk/src/bootstrap/policies/. Adds SHA256 hashing and semver versioningfor drift detection.
Stack position
PR 3 for #120 — least-privilege CDK bootstrap policies as code
Prior: ADR-002 documented the design rationale (PR #133, pending merge)
This PR: Policies as code with tests and audit artifacts
Next: Custom bootstrap template generation (#123)
Key decisions
iam.PolicyDocument/iam.PolicyStatementfor CDK interop (downstream Aspect in feat(bootstrap): CDK Aspect for policy envelope checking #125)Test plan
npx jest test/bootstrap/passes (31 tests)tsc --noEmitcompiles cleanlyReferences: RFC #120, ADR-002 (#133)
🤖 Generated with Claude Code