是什么导致 cdk bootstrap 挂起?

What causes cdk bootstrap to hang?

我正在尝试使用 cdk bootstrap 命令。

>$env:CDK_NEW_BOOTSTRAP=1
>npx cdk bootstrap --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess aws://1234.../us-east-1

我得到输出:

CDK_NEW_BOOTSTRAP set, using new-style bootstrapping.
Bootstrapping environment aws://1234.../us-east-1...

我只是挂在这一点上。在一次尝试中,一个多小时后我回来了,但它仍然卡住了。确实显示了带有前缀 cdk 的 s3 存储桶,但没有文件。

我已经尝试 运行 几次,但总是一样。

什么会导致它卡在这种方式?

更新

根据 vt102 的评论,我从命令中发现了一些错误。

>$env:CDK_NEW_BOOTSTRAP=1
>npx cdk bootstrap --cloudformation-execution-policies --verbose --debug arn:aws:iam::aws:policy/AdministratorAccess aws://1234.../us-east-1

现在的输出是:

Waiting for stack CDKToolkit to finish creating or updating...
Stack CDKToolkit has an ongoing operation in progress and is not stable (REVIEW_IN_PROGRESS (User Initiated))

关于不稳定堆栈的第二行每隔几秒重复一次。

我进入 AWS 控制台并在 CloudFormation -> Stacks 下查看,但没有列出任何堆栈。我试图更改状态过滤器,但没有任何改变。

如何找到并删除这个不稳定的堆栈并重新开始?

我记得第一次尝试cdk 命令时,我在帐号和区域中出现了语法错误。它卡住了,我杀了它。那可能是它进入这种无效状态的时候。

那个

我遇到了完全相同的问题,正在管理控制台的某处搜索堆栈。经过长时间的重装、更新等,我又被控制台骗了。我通过 AWS CLI 检查堆栈

aws cloudformation list-stacks --region eu-west-1 --profile account-id_AWSAdministratorAccess

我发现控制台隐藏了一个堆栈

"StackSummaries": [
    {
        "StackId": "arn:aws:cloudformation:eu-west-1:account-id:stack/CDKToolkit/some-uuid",
        "StackName": "CDKToolkit",
        "TemplateDescription": "This stack includes resources needed to deploy AWS CDK apps into this environment",
        "CreationTime": "2021-12-13T15:16:34.541000+00:00",
        "LastUpdatedTime": "2021-12-13T15:16:40.397000+00:00",
        "DeletionTime": "2021-12-13T15:23:40.728000+00:00",
        "StackStatus": "DELETE_IN_PROGRESS",
        "DriftInformation": {
            "StackDriftStatus": "NOT_CHECKED"
        }
    },

我可以通过以下方式删除它:

aws cloudformation delete-stack --stack-name CDKToolkit --region eu-west-1 --profile account-id_AWSAdministratorAccess

之后我又可以Bootstrap