AWS Cloudformation 停滞在 UPDATE_ROLLBACK_FAILED

AWS Cloudformation stuck in UPDATE_ROLLBACK_FAILED

我通过 AWS 无服务器应用程序模型 (SAM) 部署我的 AWS Lambda。我的一个 Lambda 使用 Numpy,我通过@keithRozario 的 Klayers 的第 3 方层引用了它。我正在使用 Klayers-python38-numpy:16 但发现它在我今天部署后已被弃用,这使我的堆栈处于 UPDATE_ROLLBACK_FAILED 状态。

一个建议是从 AWS 控制台使用 Stack actions -> Continue update rollback;我试过了,但没有用。另一种解决方案是删除堆栈。但是,这将是我第一次删除堆栈,我想知道的是:如果我通过控制台删除我的堆栈,我重新部署时会重新创建我的堆栈吗?我一直在寻找我的问题的答案,但我只找到有关删除堆栈中资源的参考资料。

我还想知道的是,我的堆栈是 AWS CodePipeline 中众多堆栈中的第一个堆栈,如果我删除堆栈,我的管道还能工作吗?此外,当我继续我的管道中的后续堆栈时,我是否会遇到更多失败的堆栈?

最后,计划是在我重新部署时更新到 Klayers-python38-numpy:19。

编辑:根据@marcin

问题 是 Klayers-python38-numpy:16,它已经部署在我的堆栈中,不再可用。我今天早上尝试对我的代码进行更改,但我的管道在 CreateChangeSet 步骤中失败了。我假设这一层不再可用的事实是我的堆栈无法回滚的原因。

我的管道是这样的:


{
    "pipeline": {
        "name": "my-pipeline",
        "roleArn": "arn:aws:iam::123456789:role/my-pipeline-CodePipelineExecutionRole-4O8PAUJGLXYZ",
        "artifactStore": {
            "type": "S3",
            "location": "my-pipeline-buildartifactsbucket-62byf2xqaa8z"
        },
        "stages": [
            {
                "name": "Source",
                "actions": [
                    {
                        "name": "SourceCodeRepo",
                        "actionTypeId": {
                            "category": "Source",
                            "owner": "ThirdParty",
                            "provider": "GitHub",
                            "version": "1"
                        },
                        "runOrder": 1,
                        "configuration": {
                            "Branch": "master",
                            "OAuthToken": "****",
                            "Owner": "hugo",
                            "Repo": "my-pipeline"
                        },
                        "outputArtifacts": [
                            {
                                "name": "SourceCodeAsZip"
                            }
                        ],
                        "inputArtifacts": []
                    }
                ]
            },
            {
                "name": "Build",
                "actions": [
                    {
                        "name": "CodeBuild",
                        "actionTypeId": {
                            "category": "Build",
                            "owner": "AWS",
                            "provider": "CodeBuild",
                            "version": "1"
                        },
                        "runOrder": 1,
                        "configuration": {
                            "ProjectName": "my-pipeline"
                        },
                        "outputArtifacts": [
                            {
                                "name": "BuildArtifactAsZip"
                            }
                        ],
                        "inputArtifacts": [
                            {
                                "name": "SourceCodeAsZip"
                            }
                        ]
                    }
                ]
            },
            {
                "name": "CI",
                "actions": [
                    {
                        "name": "CreateChangeSet",
                        "actionTypeId": {
                            "category": "Deploy",
                            "owner": "AWS",
                            "provider": "CloudFormation",
                            "version": "1"
                        },
                        "runOrder": 1,
                        "configuration": {
                            "ActionMode": "CHANGE_SET_REPLACE",
                            "Capabilities": "CAPABILITY_IAM",
                            "ChangeSetName": "my-pipeline-ChangeSet-ci",
                            "ParameterOverrides": "{\n  \"MyEnvironment\" : \"ci\"\n}\n",
                            "RoleArn": "arn:aws:iam::123456789:role/my-pipeline-CloudFormationExecutionRole-1O8GOB5C2VXYZ",
                            "StackName": "my-pipeline-ci",
                            "TemplatePath": "BuildArtifactAsZip::packaged.yaml"
                        },
                        "outputArtifacts": [],
                        "inputArtifacts": [
                            {
                                "name": "BuildArtifactAsZip"
                            }
                        ]
                    },
                    {
                        "name": "ExecuteChangeSet",
                        "actionTypeId": {
                            "category": "Deploy",
                            "owner": "AWS",
                            "provider": "CloudFormation",
                            "version": "1"
                        },
                        "runOrder": 2,
                        "configuration": {
                            "ActionMode": "CHANGE_SET_EXECUTE",
                            "ChangeSetName": "my-pipeline-ChangeSet-ci",
                            "RoleArn": "arn:aws:iam::123456789:role/my-pipeline-CloudFormationExecutionRole-1O8GOB5C2VXYZ",
                            "StackName": "my-pipeline-ci"
                        },
                        "outputArtifacts": [
                            {
                                "name": "my-pipelineCIChangeSet"
                            }
                        ],
                        "inputArtifacts": []
                    }
                ]
            },
            {
                "name": "Staging",
                "actions": [
                    {
                        "name": "CreateChangeSet",
                        "actionTypeId": {
                            "category": "Deploy",
                            "owner": "AWS",
                            "provider": "CloudFormation",
                            "version": "1"
                        },
                        "runOrder": 1,
                        "configuration": {
                            "ActionMode": "CHANGE_SET_REPLACE",
                            "Capabilities": "CAPABILITY_IAM",
                            "ChangeSetName": "my-pipeline-ChangeSet-staging",
                            "ParameterOverrides": "{\n  \"MyEnvironment\" : \"staging\"\n}\n",
                            "RoleArn": "arn:aws:iam::123456789:role/my-pipeline-CloudFormationExecutionRole-1O8GOB5C2VXYZ",
                            "StackName": "my-pipeline-staging",
                            "TemplatePath": "BuildArtifactAsZip::packaged.yaml"
                        },
                        "outputArtifacts": [],
                        "inputArtifacts": [
                            {
                                "name": "BuildArtifactAsZip"
                            }
                        ]
                    },
                    {
                        "name": "ExecuteChangeSet",
                        "actionTypeId": {
                            "category": "Deploy",
                            "owner": "AWS",
                            "provider": "CloudFormation",
                            "version": "1"
                        },
                        "runOrder": 2,
                        "configuration": {
                            "ActionMode": "CHANGE_SET_EXECUTE",
                            "ChangeSetName": "my-pipeline-ChangeSet-staging",
                            "RoleArn": "arn:aws:iam::123456789:role/my-pipeline-CloudFormationExecutionRole-1O8GOB5C2VXYZ",
                            "StackName": "my-pipeline-staging"
                        },
                        "outputArtifacts": [
                            {
                                "name": "my-pipelineStagingChangeSet"
                            }
                        ],
                        "inputArtifacts": []
                    }
                ]
            },
            {
                "name": "Prod",
                "actions": [
                    {
                        "name": "DeploymentApproval",
                        "actionTypeId": {
                            "category": "Approval",
                            "owner": "AWS",
                            "provider": "Manual",
                            "version": "1"
                        },
                        "runOrder": 1,
                        "configuration": {},
                        "outputArtifacts": [],
                        "inputArtifacts": []
                    },
                    {
                        "name": "CreateChangeSet",
                        "actionTypeId": {
                            "category": "Deploy",
                            "owner": "AWS",
                            "provider": "CloudFormation",
                            "version": "1"
                        },
                        "runOrder": 2,
                        "configuration": {
                            "ActionMode": "CHANGE_SET_REPLACE",
                            "Capabilities": "CAPABILITY_IAM",
                            "ChangeSetName": "my-pipeline-ChangeSet-prod",
                            "ParameterOverrides": "{\n  \"MyEnvironment\" : \"prod\"\n}\n",
                            "RoleArn": "arn:aws:iam::123456789:role/my-pipeline-CloudFormationExecutionRole-1O8GOB5C2VXYZ",
                            "StackName": "my-pipeline-prod",
                            "TemplatePath": "BuildArtifactAsZip::packaged.yaml"
                        },
                        "outputArtifacts": [],
                        "inputArtifacts": [
                            {
                                "name": "BuildArtifactAsZip"
                            }
                        ]
                    },
                    {
                        "name": "ExecuteChangeSet",
                        "actionTypeId": {
                            "category": "Deploy",
                            "owner": "AWS",
                            "provider": "CloudFormation",
                            "version": "1"
                        },
                        "runOrder": 3,
                        "configuration": {
                            "ActionMode": "CHANGE_SET_EXECUTE",
                            "ChangeSetName": "my-pipeline-ChangeSet-prod",
                            "RoleArn": "arn:aws:iam::123456789:role/my-pipeline-CloudFormationExecutionRole-1O8GOB5C2VXYZ",
                            "StackName": "my-pipeline-prod"
                        },
                        "outputArtifacts": [
                            {
                                "name": "my-pipelineProdChangeSet"
                            }
                        ],
                        "inputArtifacts": []
                    }
                ]
            }
        ],
        "version": 1
    }
}

if I delete my stack via the console, will my stack get recreated when I redeploy it?

是的。您可以尝试再次部署相同的堆栈,但您可能应该首先调查它失败的原因。

What I'd also like to know is, my stack is the first stack of many in an AWS CodePipeline, will my pipeline still work if I delete my stack?

不知道,但可能不是。它的用例特定,您还没有提供有关 CP 的任何信息。

Further, will I experience anymore failed stacks as I proceed to subsequent stacks within my pipeline?

如果一个操作失败,您将无法进行进一步的操作。即使可以,其他堆栈也可以依赖第一个,它们也会失败。