aws-cloudformation - GitHub 操作 : Deleting stack in AWS returns Waiter StackDeleteComplete failed: Max attempts exceeded

标签 aws-cloudformation github-actions aws-sam aws-sam-cli

如何延长超时或更改 sam delete 属性以避免 Waiter StackDeleteComplete 失败:超出最大尝试次数

这是我的 GitHub Actions 脚本:

  - uses: actions/setup-python@v4
    with:
      python-version: "3.8"

  - uses: aws-actions/setup-sam@v2

  - name: Delete SAM stack
    run: |
      sam delete \
        --stack-name $BUCKET \
        --config-file $FILE \
        --region $AWS_REGION \
        --no-prompts \

在 GitHub Actions 日志中,等待 1 分钟后我可以看到错误:

08:41:12    - Deleting Cloudformation stack 1234
08:42:13 Error: Failed to delete the stack: 1234, msg: ex: Waiter StackDeleteComplete failed: Max attempts exceeded
08:42:13 ##[error]Process completed with exit code 1.

在 AWS 中正​​确删除堆栈,但需要 3 分钟 enter image description here

有关在删除堆栈时使用 SAM 的文档不包含有关等待设置的信息:https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-delete.html

最佳答案

这是 SAM CLI 1.61.0 中的问题
目前的修复方法是使用没有此错误的早期版本的 SAM CLI:

  - uses: aws-actions/setup-sam@v2
    with:
      version: "1.60.0"

问题:https://github.com/aws/aws-sam-cli/issues/4361 修复恢复了 120 次尝试和 30 秒延迟的默认超时。

当修复发布时,配置可以恢复到标准配置:

  - uses: aws-actions/setup-sam@v2

关于aws-cloudformation - GitHub 操作 : Deleting stack in AWS returns Waiter StackDeleteComplete failed: Max attempts exceeded,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74314266/

相关文章:

node.js - AWS SAM 本地 + DynamoDB 本地

amazon-web-services - AWS SAM : Nested Stacks, 从根堆栈引用 API 网关

amazon-web-services - 无法有条件地添加 AWS::Serverless::Api 资源的 Auth 属性

json - 在 CloudFormation 中创建多个队列配置

android - 可能的 lint 错误 : Error: When targeting Android 13 or higher, 发布权限需要持有 POST_NOTIFICATIONS 权限

github - 有没有办法在一个地方收集所有 Github 操作工作流结果?

github-actions - 特定目标分支上的 Github 操作 'pull_request_review'

docker - Cloudformation堆栈,那么如何查找原因或日志

amazon-web-services - 为什么CloudFormation在添加资源标签时会替换资源?

yaml - 资源 SecretsManager 的资源属性 MySecretA 无效,如何在 yml 中创建多个 secret ?