(cli): Detect when attempting to bootstrap with older bootstrap version #23739
Labels
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
package/tools
Related to AWS CDK Tools or CLI
Describe the bug
Hi, we're encountering a weird issue ever since upgrading to v.2.60.0. We think that this change in v.2.54.0 started the cause.
Given an account bootstrapped using CDK toolkit v2.54.0+, developers using a CDK toolkit version older than v2.54.0 will create a change set for the toolkit stack and will try to update the toolkit stack (essentially trying to downgrade the toolkit stack)
This creation of change sets leads to change sets conflict when developers / CI are running bootstrap in parallel.
Sample error message when developers/builds run in parallel:
Expected Behavior
Developers running
cdk bootstrap
without a--force
option and using a CDK toolkit version older than the CDK toolkit version used to bootstrap the account should receive a warning:And not proceed to creating a change set and updating the toolkit stack.
Current Behavior
There is no warning and developers using an older CDK toolkit version are able to create a change set and try to update the deployed toolkit stack.
This leaves the deployed CDK toolkit stack in a constant flux of upgrading and downgrading and creating change sets when some developers are using v.2.54.0+ and some developers are using older versions than v.2.54.0
Reproduction Steps
npm -g aws-cdk@2.54.0
cdk bootstrap --toolkit-stack-name test-toolkit
UseExamplePermissionsBoundary
Parameternpm -g aws-cdk@2.53.0
cdk bootstrap --toolkit-stack-name test-toolkit
The issue shows where there happen to be two developers doing steps 5-8 in parallel
Possible Solution
CdkBootstrapVersion
SSM Parameter value in the packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml (?)Additional Information/Context
No response
CDK CLI Version
2.54.0
Framework Version
No response
Node.js Version
v16.16.0
OS
macOS Monterey
Language
Java
Language Version
Java 11
Other information
No response
The text was updated successfully, but these errors were encountered: