Skip to content

feat(bootstrap): custom template generator with compute-variant policies#162

Open
scottschreckengaust wants to merge 4 commits into
mainfrom
feat/bootstrap-template
Open

feat(bootstrap): custom template generator with compute-variant policies#162
scottschreckengaust wants to merge 4 commits into
mainfrom
feat/bootstrap-template

Conversation

@scottschreckengaust
Copy link
Copy Markdown
Contributor

Summary

Closes #123

Generates a custom CDK bootstrap CloudFormation template that replaces AdministratorAccess with inline least-privilege policies. Introduces per-compute-variant policy selection via ComputeTypes parameter.

Stack position

PR 4 for #120 — least-privilege CDK bootstrap policies as code

Prior: Policies as typed TypeScript (#158, merged)

This PR: Custom template + compute variants + mise tasks

Next: Resource-action-map for synth-time validation (#124)

What changed

New policies (extracted/added)

  • compute-agentcore.tsbedrock-agentcore:* extracted from observability (was conflating compute-runtime with observability concerns)
  • compute-ecs.ts — ECS Fargate permissions from DEPLOYMENT_ROLES.md (previously deferred)
  • Version bumped to 1.1.0 (policy set changed)

Template generator (cdk/scripts/generate-bootstrap-template.ts)

  • Reads CDK default bootstrap template
  • Inlines 5 managed policy resources (3 core + 2 compute variants)
  • Adds ComputeTypes parameter (default: agentcore) — operator-controlled ceiling
  • compute-ecs is CF-conditional (IncludeComputeEcs)
  • Adds outputs: BootstrapPolicyVersion, BootstrapPolicyHash, BootstrapPolicySet
  • Sets BootstrapVariant to 'ABCA: Least-Privilege Bootstrap'
  • Retains ALL default CDK bootstrap resources

Mise tasks

  • mise //cdk:bootstrap — now uses custom template
  • mise //cdk:bootstrap:generate — regenerates all artifacts from source

Architecture: sufficiency model

Bootstrap is account-level (one CDKToolkit per account/region). Multiple stacks share it.

Test plan

  • 85 tests pass across 5 test suites
  • Template has all 5 managed policy resources (ECS conditional)
  • Execution role references our policies (no AdministratorAccess)
  • CF outputs present (Version, Hash, PolicySet)
  • All default bootstrap resources preserved
  • Golden-baseline parity maintained (adjusted for extraction)
  • Artifact-sync verified
  • tsc --noEmit compiles cleanly

References: RFC #120, ADR-002 (#133)

🤖 Generated with Claude Code

scottschreckengaust and others added 4 commits May 21, 2026 01:17
…v1.1.0

Move bedrock-agentcore:* from observability policy into dedicated
compute-agentcore policy. Add compute-ecs policy from DEPLOYMENT_ROLES.md.
This enables per-compute-variant bootstrap configuration.

Closes: part of #123

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…upport

Generates a custom CDK bootstrap template that replaces AdministratorAccess
with inline least-privilege policies. Supports per-compute-variant selection
via ComputeTypes parameter. Adds PolicyVersion/Hash/Set CF outputs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…p command

mise //cdk:bootstrap now uses the custom least-privilege template.
mise //cdk:bootstrap:generate regenerates all artifacts (policies JSON,
template YAML, version/hash files) from source.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CI yarn install deduplicates transitive deps (yaml, uuid) which
mutates the lockfile if it wasn't committed in deduplicated form.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@scottschreckengaust scottschreckengaust marked this pull request as ready for review May 21, 2026 01:52
@scottschreckengaust scottschreckengaust requested a review from a team as a code owner May 21, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(bootstrap): custom bootstrap template generation

1 participant