CDK "This stack uses assets, so the toolkit stack must be deployed"
CDK deploys assets (Lambda code, Docker images, files) through a bootstrap stack that must exist in the target account and region. That account/region was never bootstrapped, so the deploy cannot find the toolkit resources.
What this error means
cdk deploy fails asking whether the environment was bootstrapped, often citing a missing /cdk-bootstrap/.../version SSM parameter. It is deterministic: until you bootstrap that account/region, every deploy with assets fails the same way.
❌ Deployment failed: Error: MyStack: SSM parameter /cdk-bootstrap/hnb659fds/version
not found. Has the environment been bootstrapped? Please run 'cdk bootstrap'.Common causes
Account/region not bootstrapped
CDK needs a bootstrap stack (S3 asset bucket, ECR repo, deploy roles) per account+region. A new account or a new region has none until cdk bootstrap runs.
Bootstrap version too old for the CLI
A newer CDK CLI may require a higher bootstrap version. An outdated bootstrap stack fails the version check even though one exists.
How to fix it
Bootstrap the target environment
Run bootstrap once per account+region with credentials that can create the toolkit stack.
cdk bootstrap aws://123456789012/us-east-1
cdk deploy MyStackRe-bootstrap when the version is stale
- Check the current version: read the
/cdk-bootstrap/<qualifier>/versionSSM parameter. - Re-run
cdk bootstrapto upgrade the toolkit stack to the version the CLI needs. - Keep the CDK CLI version pinned in CI so the required bootstrap version is stable.
How to prevent it
- Bootstrap every account+region your pipeline deploys to as a one-time setup step.
- Pin the CDK CLI version so the bootstrap version requirement does not drift.
- Use a dedicated CI role permitted to assume the CDK deploy roles.