cdk 2.1.0 synth, diff subcommands fail with "AssertDescription: CDK bootstrap stack version 6 required...". cdk 2.1.0 deploy subcommand succeeds.
See original GitHub issueWhat is the problem?
cdk synth
and cdk diff
fail with “AssertDescription: CDK bootstrap stack version 6 required. Please run ‘cdk bootstrap’ with a recent version of the CDK CLI.” after the template checks SSM for version not 1-5. The actual version in SSM is 9.
cdk deploy
succeeds.
After the successful cdk deploy
, the synth and diff continue to fail.
Reproduction Steps
- Upgrade cdk 2.0.0 to 2.1.0
- run cdk bootstrap with appropriate credentials
- create a new folder and cd to it
- create a new cdk project with
cdk init --language typescript
- cdk synth
- cdk diff
- cdk deploy
What did you expect to happen?
A clean synth with no errors displayed A clean diff with no errors displayed A clean deploy with no errors displayed
What actually happened?
for synth and diff
...
Rules:
CheckBootstrapVersion:
Assertions:
- Assert:
Fn::Not:
- Fn::Contains:
- - "1"
- "2"
- "3"
- "4"
- "5"
- Ref: BootstrapVersion
AssertDescription: CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.
for deploy - a clean, error-free execution with a CFn template produced as expected.
CDK CLI Version
2.1.0
Framework Version
2.0.0
Node.js Version
16.10.0
OS
macOS Monterey (12.0.1)
Language
Typescript
Language Version
TypeScript 4.2.4
Other information
The bootstrap CDKToolkit stack looks as expected - all of the modern template trappings (the previous bootstrap was legacy). The value of the SSM parameter /cdk-bootstrap/hnb659fds/version is 9, as expected. The cdk-hnb659fds-deploy-role-<account>-<region> role has the appropriate ssm:GetParameter permission for …/cdk-bootstrap/hnb659fds/version. the cdk-hnb659fds-lookup-role-<account>-<region> role has ssm:Get* permission for *.
“old” cdk projects continue to function as expected with cdk synth
etc.
Hoping you can deduce some bozo thing I must have overlooked or done. Thanks for whatever help you can provide.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:25 (9 by maintainers)
This is a pretty confusing thing to see when just starting with CDK. I get it now, but I would still consider it a UX bug.
I just had a fresh install of
aws-cdk 2.25.0
fromcdk init app --language typescript
confirmed problem still exist.from @njlynch’s comment https://github.com/aws/aws-cdk/issues/17942#issuecomment-992295898
For the assertion issue also happen in
cdk synth
. So it is impossible to do the first deploy before I want to confirm what to be deployed by studying the output ofcdk synth
(synthesized CloudFormation template).Workaround for typescript
For those who want to check the result before the first deploy, I suggest to temporarily add
"@aws-cdk/core:newStyleStackSynthesis": false
in yourcdk.json
After that, I can get the output![image](https://user-images.githubusercontent.com/5468398/169739570-d30ae161-5489-428e-b249-8906e918dd6d.png)