如何升级CDK引导?

l0b*_*0b0 7 amazon-web-services aws-cdk

我有一个已经引导的环境,再次引导(使用 CDK 1.106.1)似乎没有做任何事情:

\n
$ cdk bootstrap aws://unknown-account/ap-southeast-2\n\'@aws-cdk/core:newStyleStackSynthesis\' context set, using new-style bootstrapping\n[\xe2\x80\xa6]\n \xe2\x8f\xb3  Bootstrapping environment aws://unknown-account/ap-southeast-2...\nTrusted accounts:   (none)\nUsing default execution policy of \'arn:aws:iam::aws:policy/AdministratorAccess\'. Pass \'--cloudformation-execution-policies\' to customize.\n
Run Code Online (Sandbox Code Playgroud)\n

但是,下一个命令会警告引导堆栈太旧:

\n
$ cdk diff\n[\xe2\x80\xa6]\nOther Changes\n[+] Unknown Rules: {"CheckBootstrapVersion":{"Assertions":[{"Assert":{"Fn::Not":[{"Fn::Contains":[["1","2","3"],{"Ref":"BootstrapVersion"}]}]},"AssertDescription":"CDK bootstrap stack version 4 required. Please run \'cdk bootstrap\' with a recent version of the CDK CLI."}]}}\n
Run Code Online (Sandbox Code Playgroud)\n

是什么赋予了?我已经使用最新的 CDK 版本运行 bootstrap。如何升级引导程序版本?

\n
\n

我现在已经删除了“CDKToolkit”堆栈并成功重新引导,但我仍然收到相同的警告。是什么赋予了?我显然正在使用cdk bootstrap最新版本的 CDK。

\n

我现在已为此提交了CDK 问题。

\n
\n

相关项目问题;建造。

\n

l0b*_*0b0 7

由 @rix0rrr 回答:

其实并没有什么错。它cdk diff告诉您有关Rule添加到模板中的 a 的信息,但它实际上并不知道其含义Rule,因此以令人困惑的方式打印它。

下次部署后差异将消失。


Muh*_*ani 5

我来到此页面是因为我遇到了与引导程序被视为旧相关的问题。

“--cloudformation-execution-policies 只能传递给现代引导体验。”

文章https://docs.aws.amazon.com/cdk/latest/guide/cdk_pipeline.html中的以下命令给了我一个错误。事实证明,在我的情况下,导出(linux/MacOS)和设置(windows)被混合在一起。

export CDK_NEW_BOOTSTRAP=1
npx cdk bootstrap aws://315997497220/us-east-1 --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess aws://315997497220/us-east-1
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述