AWS Cloud Formation Stuck in Review_In_Progress

后端 未结 2 657
没有蜡笔的小新
没有蜡笔的小新 2020-12-20 14:41

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/automat

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-20 15:15

    Overview

    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.

    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 example

    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 and CHANGE_SET_EXECUTE example

    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
    }
    

提交回复
热议问题