-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Describe the bug
The CloudFormation stack created via cdk bootstrap
fails to create any resources when run using temporary credentials via was-vault. It fails with the error:
The security token included in the request is invalid
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Library Version
No response
Expected Behavior
Bootstrap successfully runs using the temporary credentials.
Current Behavior
Bootstrap creates the CloudFormation stack but fails to create the resources. It then fails to rollback due to the same permissions error.
Reproduction Steps
- Init a new project with
cdk init app --language typescript
- Update stack to set the right account ID and region
- Run
was-vault exec <profile> -- npx cdk bootstrap
Possible Solution
No response
Additional Information/Context
I was trying to bootstrap my account using the cdk bootstrap
command using aws-vault for authentication. This creates a session which is passed through to the subprocess via the environment variables:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
When I ran the bootstrap just using my long lived access key (via the --no-session
flag on was-vault), the CloudFormation stack was able to successfully create all the resources.
AWS CDK Library version (aws-cdk-lib)
2.206.0
AWS CDK CLI version
2.1023.0 (build 45ceb89)
Node.js Version
v24.4.1
OS
MacOS
Language
TypeScript
Language Version
No response
Other information
No response