Why is my AWS CloudFormation stack stuck in the REVIEW_IN_PROGRESS state?

Last updated: 2022-04-19

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 means that you tried to create the stack using a change set that wasn't executed. 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.

Note: If you receive errors when running AWS CLI commands, make sure that you’re using the most recent AWS CLI version.

Resolution

Complete the following steps to execute a change set using your preferred method.

Using the AWS CloudFormation console

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

Using AWS Command Line Interface (AWS CLI)

1.    Run the following list-change-sets command to list all the change sets:

aws cloudformation list-change-sets --stack-name StackName

2.    Identify the change set, and run the following execute-change-set command:

aws cloudformation execute-change-set -–change-set-name ChangeSetName

Using AWS CodePipeline console

Using AWS CodePipeline to deploy to CloudFormation with the Create or replace a change set action mode, only creates or replaces the change set. It doesn't automatically execute it. To execute the change set, you must add the Execute a change set action mode.

  1. Open the AWS 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.
  5. In the Action name, enter the name of your action.
  6. For Action provider, select AWS CloudFormation.
  7. For Action mode, select Execute a change set.
  8. Choose Save.

Using AWS CLI

1.    Run the following get-pipeline command to copy the pipeline structure into a JSON file:

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

2.    Add CHANGE_SET_EXECUTE as the ActionMode in the Deploy stage:

{
  "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.    Run the following update-pipeline command to copy the pipeline into a JSON file:

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

Did this article help?


Do you need billing or technical support?