AWS云形成陷在Review_In_Progress中 [英] AWS Cloud Formation Stuck in Review_In_Progress

查看:103
本文介绍了AWS云形成陷在Review_In_Progress中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图按照文档中所述使用Java-8为AWS Lambda的AWS SAM设置AWS Code Pipeline

I was trying to set up AWS Code Pipeline with AWS SAM for Lambda using Java-8 as mentioned in the documentations

http://docs.aws.amazon.com/lambda/latest/dg/automating-deployment.html
(示例在node.js中)。

http://docs.aws.amazon.com/lambda/latest/dg/automating-deployment.html (example is in node.js though).

但是,我的登台停留在CloudFormation Stack上的原因是停留在REVIEW_IN_PROGRESS了很长时间。有什么方法可以调试此问题?

However, my Staging is stuck at CloudFormation Stack is stuck in REVIEW_IN_PROGRESS for a long time. Is there any way to debug this issue?

我在控制台中看不到其他事件。有什么要检查的东西吗?

I don't see any further events coming in console. Is there any specific things to check for?

模板如下

$ aws codepipeline get-pipeline --region us-east-1 --name aws-lexbot-facebook-pipeline
{
    "pipeline": {
        "roleArn": "arn:aws:iam::XXXXXXXXXXXX:role/AWS-CodePipeline-Service", 
        "stages": [
            {
                "name": "Source", 
                "actions": [
                    {
                        "inputArtifacts": [], 
                        "name": "Source", 
                        "actionTypeId": {
                            "category": "Source", 
                            "owner": "ThirdParty", 
                            "version": "1", 
                            "provider": "GitHub"
                        }, 
                        "outputArtifacts": [
                            {
                                "name": "MyApp"
                            }
                        ], 
                        "configuration": {
                            "Owner": "xxxxxxx", 
                            "Repo": "lexbot", 
                            "PollForSourceChanges": "true", 
                            "Branch": "master", 
                            "OAuthToken": "****"
                        }, 
                        "runOrder": 1
                    }
                ]
            }, 
            {
                "name": "Build", 
                "actions": [
                    {
                        "inputArtifacts": [
                            {
                                "name": "MyApp"
                            }
                        ], 
                        "name": "CodeBuild", 
                        "actionTypeId": {
                            "category": "Build", 
                            "owner": "AWS", 
                            "version": "1", 
                            "provider": "CodeBuild"
                        }, 
                        "outputArtifacts": [
                            {
                                "name": "MyAppBuild"
                            }
                        ], 
                        "configuration": {
                            "ProjectName": "aws-lexbot-facebook-codebuild"
                        }, 
                        "runOrder": 1
                    }
                ]
            }, 
            {
                "name": "Staging", 
                "actions": [
                    {
                        "inputArtifacts": [
                            {
                                "name": "MyAppBuild"
                            }
                        ], 
                        "name": "LexBotBetaStack", 
                        "actionTypeId": {
                            "category": "Deploy", 
                            "owner": "AWS", 
                            "version": "1", 
                            "provider": "CloudFormation"
                        }, 
                        "outputArtifacts": [], 
                        "configuration": {
                            "ActionMode": "CHANGE_SET_REPLACE", 
                            "ChangeSetName": "LexBotChangeSet", 
                            "RoleArn": "arn:aws:iam::XXXXXXXXXXX:role/cloudformation-lambda-execution-role", 
                            "Capabilities": "CAPABILITY_IAM", 
                            "StackName": "LexBotBetaStack", 
                            "TemplatePath": "MyAppBuild::SamTemplate.yaml"
                        }, 
                        "runOrder": 1
                    }
                ]
            }
        ], 
        "artifactStore": {
            "type": "S3", 
            "location": "XXXXXX-us-east-1-987802409920"
        }, 
        "name": "aws-lexbot-facebook-pipeline", 
        "version": 1
    }
}


推荐答案

概述

在您的CodePipeline步骤中,您使用的是 CHANGE_SET_CREATE 操作模式。这将在CloudFormation堆栈上创建一个更改集,但不会自动执行它。您需要执行第二个操作,该操作使用 CHANGE_SET_EXECUTE 执行更改集。或者,您可以将操作的操作模式更改为 CREATE_UPDATE ,这应直接更新您的操作。

In your CodePipeline step, you're using the CHANGE_SET_CREATE action mode. This creates a change set on the CloudFormation Stack, but does not automatically execute it. You would need a second action that executes the change set using CHANGE_SET_EXECUTE. Alternatively, you can change the action mode on your action to CREATE_UPDATE which should directly update your action.

一个原因您可能想在CodePipeline中使用 CHANGE_SET_CREATE CHANGE_SET_EXECUTE ,如果您想在它们之间进行批准。如果您希望自动完成此操作,建议使用 CREATE_UPDATE

One reason you might want to use CHANGE_SET_CREATE and CHANGE_SET_EXECUTE in CodePipeline, is if you want to have an approval step between them. If you are expecting this to be completed automatically, I'd recommend CREATE_UPDATE.

CREATE_UPDATE示例

下面是您的CodePipeline 登台阶段,但是使用 CREATE_UPDATE CREATE_CHANGE_SET 。这将创建一个名为stack的新堆栈,或者更新现有堆栈(如果已存在具有该名称的堆栈)。

Below is your CodePipeline Staging stage, but using CREATE_UPDATE instead of CREATE_CHANGE_SET. This creates a new stack named stack, or updates the existing one if one with that name already exists.

{
    "inputArtifacts": [
        {
            "name": "MyAppBuild"
        }
    ], 
    "name": "LexBotBetaStack", 
    "actionTypeId": {
        "category": "Deploy", 
        "owner": "AWS", 
        "version": "1", 
        "provider": "CloudFormation"
    }, 
    "outputArtifacts": [], 
    "configuration": {
        "ActionMode": "CREATE_UPDATE", 
        "ChangeSetName": "LexBotChangeSet", 
        "RoleArn": "arn:aws:iam::XXXXXXXXXXX:role/cloudformation-lambda-execution-role", 
        "Capabilities": "CAPABILITY_IAM", 
        "StackName": "LexBotBetaStack", 
        "TemplatePath": "MyAppBuild::SamTemplate.yaml"
    }, 
    "runOrder": 1
}

CHANGE_SET_CREATE和CHANGE_SET_EXECUTE示例

以下是如何使用 CHANGE_SET_CREATE CHANGE_SET_EXECUTE 的示例code>在一起。它首先在命名堆栈上创建一个变更集,然后执行该变更集。如果您希望在变更集和执行变更之间有一个CodePipeline批准步骤,则非常有用,这样您就可以查看预期的变更。

Below is an example of how you could use CHANGE_SET_CREATE and CHANGE_SET_EXECUTE together. It first creates a change set, on the named stack, then executes that change set. It's really useful if you want to have a CodePipeline Approval step between the change set, and executing it, so you can review the intended changes.

{
    "inputArtifacts": [
        {
            "name": "MyAppBuild"
        }
    ], 
    "name": "LexBotBetaStackChangeSet", 
    "actionTypeId": {
        "category": "Deploy", 
        "owner": "AWS", 
        "version": "1", 
        "provider": "CloudFormation"
    }, 
    "outputArtifacts": [], 
    "configuration": {
        "ActionMode": "CHANGE_SET_REPLACE", 
        "ChangeSetName": "LexBotChangeSet", 
        "RoleArn": "arn:aws:iam::XXXXXXXXXXX:role/cloudformation-lambda-execution-role", 
        "Capabilities": "CAPABILITY_IAM", 
        "StackName": "LexBotBetaStack", 
        "TemplatePath": "MyAppBuild::SamTemplate.yaml"
    }, 
    "runOrder": 1
},
{
    "name": "LexBotBetaStackExecute", 
    "actionTypeId": {
        "category": "Deploy", 
        "owner": "AWS", 
        "version": "1", 
        "provider": "CloudFormation"
    }, 
    "configuration": {
        "ActionMode": "CHANGE_SET_EXECUTE", 
        "ChangeSetName": "LexBotChangeSet", 
        "StackName": "LexBotBetaStack", 
    }, 
    "runOrder": 2
}

这篇关于AWS云形成陷在Review_In_Progress中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆