Why is my CloudFormation stack stuck in the REVIEW_IN_PROGRESS state?

3 minute read
1

My AWS CloudFormation stack is stuck in the REVIEW_IN_PROGRESS state.

Short description

A stack that's stuck in the REVIEW_IN_PROGRESS state shows that you used a change set that wasn't executed when you tried to create the stack. When you create a change set for a new stack, CloudFormation creates a unique stack ID, but no resources. If you don't execute the change set, then the stack remains in the REVIEW_IN_PROGRESS state.

Resolution

To execute the change set, use the CloudFormation console, the AWS Command Line Interface (AWS CLI), or AWS CodePipeline.

CloudFormation console

To use the CloudFormation console to execute the change set, complete the following steps:

  1. Open the CloudFormation console.
  2. In the navigation pane, choose Stacks, and then select the stack that's stuck.
  3. Choose the Change Sets tab.
  4. Select the latest change set and review the changes.
  5. To create the stack, choose Execute.

AWS CLI

Note: If you receive errors when you run AWS CLI commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

To use the AWS CLI to execute the change set, complete the following steps:

  1. To list all the change sets, run the following list-change-sets command:
    aws cloudformation list-change-sets --stack-name StackName
    Note: Replace StackName with your stack name.
  2. Identify the change set that you need to update, and then run the following execute-change-set command:
    aws cloudformation execute-change-set --change-set-name ChangeSetName
    Note: Replace ChangeSetName with the change set name.

CodePipeline

To use the CodePipeline console to execute the change set, complete the following steps:

  1. Open the CodePipeline console.
  2. Identify the pipeline that's deploying to CloudFormation.
  3. Choose Edit, and then choose Edit Deploy stage.
  4. Choose Add Action group, and then configure the following settings:
    For Action name, enter the name of your action.
    For Action provider, select AWS CloudFormation.
    For Action mode, select Execute a change set.
  5. Choose Save.

To use the AWS CLI to use CodePipeline to execute the change set, complete the following steps:

  1. To get the pipeline structure into a JSON file, run the following get-pipeline command:

    aws codepipeline get-pipeline --name MyPipeline >pipeline.json

    Note: Replace MyPipeline with your pipeline name.

  2. Edit the JSON file to add a new action in the Deploy stage. For ActionMode, enter CHANGE_SET_EXECUTE:

    {  "name": "Deploy",
      "blockers": null,
      "actions": [
        {
          "name": "Deploy",
          "actionTypeId": {
            "category": "Deploy",
            "owner": "AWS",
            "provider": "CloudFormation",
            "version": "1"
          },
          "runOrder": 1,
          "configuration": {
            "TemplatePath": "SourceArtifact::ssm.yml",
            "ActionMode": "CHANGE_SET_REPLACE",
            "Capabilities": "CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND",
            "ChangeSetName": "CFNTest-CS",
            "RoleArn": "arn:aws:iam::xxxxx:role/xxx",
            "StackName": "CFNTest"
          },
          "outputArtifacts": [],
          "inputArtifacts": [
            {
              "name": "SourceArtifact"
            }
          ],
          "roleArn": null,
          "region": "us-east-1",
          "namespace": "DeployVariables"
        },
        {
          "name": "ExecuteChangeSet",
          "actionTypeId": {
            "category": "Deploy",
            "owner": "AWS",
            "provider": "CloudFormation",
            "version": "1"
          },
          "runOrder": 2,
          "configuration": {
            "ActionMode": "CHANGE_SET_EXECUTE",
            "ChangeSetName": "CFNTest-CS",
            "StackName": "CFNTest"
          },
          "outputArtifacts": [],
          "inputArtifacts": [
            {
              "name": "SourceArtifact"
            }
          ],
          "roleArn": null,
          "region": "us-east-1",
          "namespace": null
        }
      ]
    }
  3. To apply your changes, run the following update-pipeline command:

    aws codepipeline update-pipeline --cli-input-json file://pipeline.json

    The update-pipeline command stops the pipeline, including any running revisions. The next time you change the source location, the pipeline automatically runs that revision through the revised pipeline structure. To manually run the last revision through the revised structure of the pipeline, run the start-pipeline-execution command:

    aws codepipeline start-pipeline-execution --name MyPipeline

    Note: Replace MyPipeline with your pipeline name.

AWS OFFICIAL
AWS OFFICIALUpdated 20 days ago
2 Comments

For people copying and pasting, the second hyphen in --change-set-name in the aws cloudformation execute-change-set --change-set-name ChangeSetName example is "the wrong kind of hyphen" ;-)

replied a year ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

profile pictureAWS
MODERATOR
replied a year ago