aws-cdk

How to determine and change AWS CDK bootstrap version?


I am getting this error:

arn:aws:cloudformation:us-east-1:<account>:stack/cdk-workshop/79cdc290-bb48-11ec-87f4-0a9e17cd1915
current credentials could not be used to assume 'arn:aws:iam::<account>:role/cdk-hnb659fds-lookup-role-<account>-us-east-1', but are for the right account. Proceeding anyway.
(To get rid of this warning, please upgrade to bootstrap version >= 8)

Everything works correctly, but I cannot find any documentation to tell me what bootstrap version I am on or how to change it. I have used npm to update the CDK version and then re-ran bootstrap without succcess.


Solution

  • You can check the AWS Cloudformation stack, and find a stack named "CDKToolkit". The version of the value of the output key name "BootstrapVersion" in the stack. If you can't find the "CDKToolkit" stack or just try to fix the problem quickly. You can exec 'npm bootstrap' under your project. CDK will create/update it for you.