

# Monitor stack progress
<a name="monitor-stack-progress"></a>

This section describes how to monitor a stack deployment that is currently in progress. CloudFormation provides a detailed, chronological list of deployment events, showing the progress and any issues encountered during the deployment.

**Topics**
+ [View stack events](view-stack-events.md)
+ [View stack events by operation](view-stack-events-by-operation.md)
+ [View stack deployment timeline graph](stack-deployment-timeline-graph.md)
+ [Understand stack creation events](stack-resource-configuration-complete.md)
+ [Monitor stack updates](using-cfn-updating-stacks-monitor-stack.md)
+ [

# Continue rolling back an update
](using-cfn-updating-stacks-continueupdaterollback.md)
+ [

# Determine the cause of a stack failure
](determine-root-cause-for-stack-failures.md)
+ [Stack failure options](stack-failure-options.md)

# View CloudFormation stack events
<a name="view-stack-events"></a>

You can view stack events to monitor the progress and status of your stack and resources in the stack. Stack events help you understand when resources are being created, updated, or deleted, and whether the stack deployment is proceeding as expected. 

**Topics**
+ [

## View stack events (console)
](#view-stack-events-console)
+ [

## View stack events (AWS CLI)
](#view-stack-events-cli)
+ [

## Stack status codes
](#cfn-console-view-stack-data-resources-status-codes)

## View stack events (console)
<a name="view-stack-events-console"></a>

**To view stack events**

1. Open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).

1. On the navigation bar at the top of the screen, choose the AWS Region you created the stack in.

1. On the **Stacks** page of the CloudFormation console, select the stack name. CloudFormation displays the stack details for the selected stack.

1. Choose the **Events** tab to view the stack events CloudFormation has generated for your stack. 

CloudFormation automatically refreshes the stack events every minute. Additionally, CloudFormation displays the **New events available** badge when new stack events occur. Choose the refresh icon to load these events into the list. By viewing stack creation events, you can understand the sequence of events that lead to your stack's creation (or failure, if you are debugging your stack).

While your stack is being created, it's listed on the **Stacks** page with a status of `CREATE_IN_PROGRESS`. After your stack has been successfully created, its status changes to `CREATE_COMPLETE`.

For more information, see [Understand CloudFormation stack creation events](stack-resource-configuration-complete.md) and [Monitor the progress of a stack update](using-cfn-updating-stacks-monitor-stack.md).

## View stack events (AWS CLI)
<a name="view-stack-events-cli"></a>

Alternatively, you can use the [describe-stack-events](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/describe-stack-events.html) command while the stack is being created to view events as they're reported.

The following **describe-stack-events** command describes the `my-stack` stack events.

```
aws cloudformation describe-stack-events --stack-name my-stack
```

The following is an example response.

```
{
    "StackEvents": [
        {
            "StackId": "arn:aws:cloudformation:aws-region:123456789012:stack/my-stack/64726230-7edf-11f0-8a36-06453a64f325",
            "EventId": "7b755820-7edf-11f0-ab15-0673b09f3847",
            "StackName": "my-stack",
            "LogicalResourceId": "my-stack",
            "PhysicalResourceId": "arn:aws:cloudformation:aws-region:123456789012:stack/my-stack/64726230-7edf-11f0-8a36-06453a64f325",
            "ResourceType": "AWS::CloudFormation::Stack",
            "Timestamp": "2025-08-21T22:37:56.243000+00:00",
            "ResourceStatus": "CREATE_COMPLETE",
            "ClientRequestToken": "token"
        },
        {
            "StackId": "arn:aws:cloudformation:aws-region:123456789012:stack/my-stack/64726230-7edf-11f0-8a36-06453a64f325",
            "EventId": "WebServer-CREATE_COMPLETE-2025-08-21T22:37:54.356Z",
            "StackName": "my-stack",
            "LogicalResourceId": "WebServer",
            "PhysicalResourceId": "i-099df76cb31b866a9",
            "ResourceType": "AWS::EC2::Instance",
            "Timestamp": "2025-08-21T22:37:54.356000+00:00",
            "ResourceStatus": "CREATE_COMPLETE",
            "ResourceProperties": "{\"UserData\":\"IyEvYmluL2Jhc2gKeXVtIGluc3RhbGwgLXkgYXdzLWNmbi1ib290c3RyYXAKL29wdC9hd3MvYmluL2Nmbi1pbml0IC12IC0tc3RhY2sgc2Rmc2RhZnNhZHNka2wgLS1yZXNvdXJjZSBXZWJTZXJ2ZXIgLS1yZWdpb24gdXMtd2VzdC0yCg==\",\"ImageId\":\"ami-0bbc328167dee8f3c\",\"InstanceType\":\"t2.micro\",\"SecurityGroupIds\":[\"my-stack-WebServerSecurityGroup-n8A43bQT1ty2\"],\"Tags\":[{\"Value\":\"Bootstrap Tutorial Web Server\",\"Key\":\"Name\"}]}",
            "ClientRequestToken": "token"
        },
        {
            "StackId": "arn:aws:cloudformation:aws-region:123456789012:stack/my-stack/64726230-7edf-11f0-8a36-06453a64f325",
            "EventId": "WebServer-CREATE_IN_PROGRESS-2025-08-21T22:37:31.226Z",
            "StackName": "my-stack",
            "LogicalResourceId": "WebServer",
            "PhysicalResourceId": "i-099df76cb31b866a9",
            "ResourceType": "AWS::EC2::Instance",
            "Timestamp": "2025-08-21T22:37:31.226000+00:00",
            "ResourceStatus": "CREATE_IN_PROGRESS",
            "ResourceStatusReason": "Resource creation Initiated",
            "ResourceProperties": "{\"UserData\":\"IyEvYmluL2Jhc2gKeXVtIGluc3RhbGwgLXkgYXdzLWNmbi1ib290c3RyYXAKL29wdC9hd3MvYmluL2Nmbi1pbml0IC12IC0tc3RhY2sgc2Rmc2RhZnNhZHNka2wgLS1yZXNvdXJjZSBXZWJTZXJ2ZXIgLS1yZWdpb24gdXMtd2VzdC0yCg==\",\"ImageId\":\"ami-0bbc328167dee8f3c\",\"InstanceType\":\"t2.micro\",\"SecurityGroupIds\":[\"my-stack-WebServerSecurityGroup-n8A43bQT1ty2\"],\"Tags\":[{\"Value\":\"Bootstrap Tutorial Web Server\",\"Key\":\"Name\"}]}",
            "ClientRequestToken": "token"
        },
        {
            "StackId": "arn:aws:cloudformation:aws-region:123456789012:stack/my-stack/64726230-7edf-11f0-8a36-06453a64f325",
            "EventId": "WebServer-CREATE_IN_PROGRESS-2025-08-21T22:37:29.210Z",
            "StackName": "my-stack",
            "LogicalResourceId": "WebServer",
            "PhysicalResourceId": "",
            "ResourceType": "AWS::EC2::Instance",
            "Timestamp": "2025-08-21T22:37:29.210000+00:00",
            "ResourceStatus": "CREATE_IN_PROGRESS",
            "ResourceProperties": "{\"UserData\":\"IyEvYmluL2Jhc2gKeXVtIGluc3RhbGwgLXkgYXdzLWNmbi1ib290c3RyYXAKL29wdC9hd3MvYmluL2Nmbi1pbml0IC12IC0tc3RhY2sgc2Rmc2RhZnNhZHNka2wgLS1yZXNvdXJjZSBXZWJTZXJ2ZXIgLS1yZWdpb24gdXMtd2VzdC0yCg==\",\"ImageId\":\"ami-0bbc328167dee8f3c\",\"InstanceType\":\"t2.micro\",\"SecurityGroupIds\":[\"my-stack-WebServerSecurityGroup-n8A43bQT1ty2\"],\"Tags\":[{\"Value\":\"Bootstrap Tutorial Web Server\",\"Key\":\"Name\"}]}",
            "ClientRequestToken": "token"
        },
        {
            "StackId": "arn:aws:cloudformation:aws-region:123456789012:stack/my-stack/64726230-7edf-11f0-8a36-06453a64f325",
            "EventId": "WebServerSecurityGroup-CREATE_COMPLETE-2025-08-21T22:37:28.803Z",
            "StackName": "my-stack",
            "LogicalResourceId": "WebServerSecurityGroup",
            "PhysicalResourceId": "my-stack-WebServerSecurityGroup-n8A43bQT1ty2",
            "ResourceType": "AWS::EC2::SecurityGroup",
            "Timestamp": "2025-08-21T22:37:28.803000+00:00",
            "ResourceStatus": "CREATE_COMPLETE",
            "ResourceProperties": "{\"GroupDescription\":\"Allow HTTP access from my IP address\",\"SecurityGroupIngress\":[{\"CidrIp\":\"0.0.0.0/0\",\"Description\":\"HTTP\",\"FromPort\":\"80\",\"ToPort\":\"80\",\"IpProtocol\":\"tcp\"}]}",
            "ClientRequestToken": "token"
        },
        {
            "StackId": "arn:aws:cloudformation:aws-region:123456789012:stack/my-stack/64726230-7edf-11f0-8a36-06453a64f325",
            "EventId": "WebServerSecurityGroup-CREATE_IN_PROGRESS-2025-08-21T22:37:22.626Z",
            "StackName": "my-stack",
            "LogicalResourceId": "WebServerSecurityGroup",
            "PhysicalResourceId": "my-stack-WebServerSecurityGroup-n8A43bQT1ty2",
            "ResourceType": "AWS::EC2::SecurityGroup",
            "Timestamp": "2025-08-21T22:37:22.626000+00:00",
            "ResourceStatus": "CREATE_IN_PROGRESS",
            "ResourceStatusReason": "Resource creation Initiated",
            "ResourceProperties": "{\"GroupDescription\":\"Allow HTTP access from my IP address\",\"SecurityGroupIngress\":[{\"CidrIp\":\"0.0.0.0/0\",\"Description\":\"HTTP\",\"FromPort\":\"80\",\"ToPort\":\"80\",\"IpProtocol\":\"tcp\"}]}",
            "ClientRequestToken": "token"
        },
        {
            "StackId": "arn:aws:cloudformation:aws-region:123456789012:stack/my-stack/64726230-7edf-11f0-8a36-06453a64f325",
            "EventId": "WebServerSecurityGroup-CREATE_IN_PROGRESS-2025-08-21T22:37:20.186Z",
            "StackName": "my-stack",
            "LogicalResourceId": "WebServerSecurityGroup",
            "PhysicalResourceId": "",
            "ResourceType": "AWS::EC2::SecurityGroup",
            "Timestamp": "2025-08-21T22:37:20.186000+00:00",
            "ResourceStatus": "CREATE_IN_PROGRESS",
            "ResourceProperties": "{\"GroupDescription\":\"Allow HTTP access from my IP address\",\"SecurityGroupIngress\":[{\"CidrIp\":\"0.0.0.0/0\",\"Description\":\"HTTP\",\"FromPort\":\"80\",\"ToPort\":\"80\",\"IpProtocol\":\"tcp\"}]}",
            "ClientRequestToken": "token"
        },
        {
            "StackId": "arn:aws:cloudformation:aws-region:123456789012:stack/my-stack/64726230-7edf-11f0-8a36-06453a64f325",
            "EventId": "64740fe0-7edf-11f0-8a36-06453a64f325",
            "StackName": "my-stack",
            "LogicalResourceId": "my-stack",
            "PhysicalResourceId": "arn:aws:cloudformation:aws-region:123456789012:stack/my-stack/64726230-7edf-11f0-8a36-06453a64f325",
            "ResourceType": "AWS::CloudFormation::Stack",
            "Timestamp": "2025-08-21T22:37:17.819000+00:00",
            "ResourceStatus": "CREATE_IN_PROGRESS",
            "ResourceStatusReason": "User Initiated",
            "ClientRequestToken": "token"
        }
    ]
}
```

The most recent events are reported first. The following table describe the fields returned by the **describe-stack-events** command:


| Field | Description | 
| --- | --- | 
| EventId |  Event identifier.  | 
| StackName |  Name of the stack that the event corresponds to.  | 
| StackId |  Identifier of the stack that the event corresponds to.  | 
| LogicalResourceId |  Logical identifier of the resource.  | 
| PhysicalResourceId |  Physical identifier of the resource.  | 
| ResourceProperties |  Properties of the resource.  | 
| ResourceType |  Type of the resource.  | 
| Timestamp |  Time when the event occurred.  | 
| ResourceStatus |  The status of the resource, which can be one of the following status codes: `CREATE_COMPLETE` \$1 `CREATE_FAILED` \$1 `CREATE_IN_PROGRESS` \$1 `DELETE_COMPLETE` \$1 `DELETE_FAILED` \$1 `DELETE_IN_PROGRESS` \$1 `DELETE_SKIPPED` \$1 `IMPORT_COMPLETE` \$1 `IMPORT_IN_PROGRESS` \$1 `IMPORT_ROLLBACK_COMPLETE` \$1 `IMPORT_ROLLBACK_FAILED` \$1 `IMPORT_ROLLBACK_IN_PROGRESS` \$1 `REVIEW_IN_PROGRESS` \$1 `ROLLBACK_COMPLETE` \$1 `ROLLBACK_FAILED` \$1 `ROLLBACK_IN_PROGRESS` \$1 `UPDATE_COMPLETE` \$1 `UPDATE_COMPLETE_CLEANUP_IN_PROGRESS` \$1 `UPDATE_FAILED` \$1 `UPDATE_IN_PROGRESS` \$1 `UPDATE_ROLLBACK_COMPLETE` \$1 `UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS` \$1 `UPDATE_ROLLBACK_FAILED` \$1 `UPDATE_ROLLBACK_IN_PROGRESS` The `DELETE_SKIPPED` status applies to resources with a deletion policy attribute of retain.  | 
| DetailedStatus |  The detailed status of the stack. If `CONFIGURATION_COMPLETE` is present, the stack resources configuration phase has completed and the stabilization of the resources is in progress.  | 
| ResourceStatusReason |  More information on the status.  | 

## Stack status codes
<a name="cfn-console-view-stack-data-resources-status-codes"></a>

The following table describes stack status codes:


| Stack status and optional detailed status | Description | 
| --- | --- | 
|  `CREATE_COMPLETE`  |  Successful creation of one or more stacks.  | 
|  `CREATE_IN_PROGRESS`  |  Ongoing creation of one or more stacks.  | 
|  `CREATE_FAILED`  |  Unsuccessful creation of one or more stacks. View the stack events to see any associated error messages. Possible reasons for a failed creation include insufficient permissions to work with all resources in the stack, parameter values rejected by an AWS service, or a timeout during resource creation.  | 
|  `DELETE_COMPLETE`  |  Successful deletion of one or more stacks. Deleted stacks are retained and viewable for 90 days.  | 
|  `DELETE_FAILED`  |  Unsuccessful deletion of one or more stacks. Because the delete failed, you might have some resources that are still running; however, you can't work with or update the stack. Delete the stack again or view the stack events to see any associated error messages.  | 
|  `DELETE_IN_PROGRESS`  |  Ongoing removal of one or more stacks.  | 
| `REVIEW_IN_PROGRESS` | Ongoing creation of one or more stacks with an expected StackId but without any templates or resources. A stack with this status code counts against the [maximum possible number of stacks](cloudformation-limits.md).  | 
|  `ROLLBACK_COMPLETE`  |  Successful removal of one or more stacks after a failed stack creation or after an explicitly canceled stack creation. The stack returns to the previous working state. Any resources that were created during the create stack operation are deleted. This status exists only after a failed stack creation. It signifies that all operations from the partially created stack have been appropriately cleaned up. When in this state, only a delete operation can be performed.  | 
|  `ROLLBACK_FAILED`  |  Unsuccessful removal of one or more stacks after a failed stack creation or after an explicitly canceled stack creation. Delete the stack or view the stack events to see any associated error messages.  | 
|  `ROLLBACK_IN_PROGRESS`  |  Ongoing removal of one or more stacks after a failed stack creation or after an explicitly canceled stack creation.  | 
|  `UPDATE_COMPLETE`  | Successful update of one or more stacks. | 
|  `UPDATE_COMPLETE_CLEANUP_IN_PROGRESS`  |  Ongoing removal of old resources for one or more stacks after a successful stack update. For stack updates that require resources to be replaced, CloudFormation creates the new resources first and then deletes the old resources to help reduce any interruptions with your stack. In this state, the stack has been updated and is usable, but CloudFormation is still deleting the old resources.  | 
|  `UPDATE_FAILED`  | Unsuccessful update of one or more stacks. View the stack events to see any associated error messages. | 
|  `UPDATE_IN_PROGRESS`  |  Ongoing update of one or more stacks.  | 
|  `UPDATE_ROLLBACK_COMPLETE`  |  Successful return of one or more stacks to a previous working state after a failed stack update.  | 
|  `UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS`  |  Ongoing removal of new resources for one or more stacks after a failed stack update. In this state, the stack has been rolled back to its previous working state and is usable, but CloudFormation is still deleting any new resources it created during the stack update.  | 
|  `UPDATE_ROLLBACK_FAILED`  |  Unsuccessful return of one or more stacks to a previous working state after a failed stack update. When in this state, you can delete the stack or [continue rollback](using-cfn-updating-stacks-continueupdaterollback.md). You might need to fix errors before your stack can return to a working state. Or, you can contact Support to restore the stack to a usable state.  | 
|  `UPDATE_ROLLBACK_IN_PROGRESS`  |  Ongoing return of one or more stacks to the previous working state after failed stack update.  | 
|  `IMPORT_IN_PROGRESS`  |  The import operation is currently in progress.  | 
|  `IMPORT_COMPLETE`  |  The import operation successfully completed for all resources in the stack that support `resource import`.  | 
|  `IMPORT_ROLLBACK_IN_PROGRESS`  |  Import will roll back to the previous template configuration.  | 
|  `IMPORT_ROLLBACK_FAILED`  |  The import rollback operation failed for at least one resource in the stack. Results will be available for the resources CloudFormation successfully imported.  | 
|  `IMPORT_ROLLBACK_COMPLETE`  |  Import successfully rolled back to the previous template configuration.  | 

# View stack events by operation
<a name="view-stack-events-by-operation"></a>

You can view stack events grouped by operation to better understand the sequence and scope of changes made to your stack. Operation-based grouping helps you track related events together, making it easier to monitor progress and troubleshoot issues when they occur.

Each stack operation (create, update, delete, rollback) is assigned a unique operation ID that groups all related events. This allows you to focus on specific operations and quickly identify the root cause of failures.

**Topics**
+ [

## Prerequisites
](#view-stack-events-by-operation-prerequisites)
+ [

## View stack events by operation (console)
](#view-stack-events-by-operation-console)
+ [

## View stack events by operation (AWS CLI)
](#view-stack-events-by-operation-cli)
+ [

## Stack status codes
](#stack-status-codes)

## Prerequisites
<a name="view-stack-events-by-operation-prerequisites"></a>

To use `DescribeEvents` API, you must have the necessary IAM permissions to: `DescribeEvents`.

## View stack events by operation (console)
<a name="view-stack-events-by-operation-console"></a>

**To view stack events grouped by operation**

1. Sign in to the AWS Management Console and open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).

1. On the navigation bar at the top of the screen, choose the AWS Region you created the stack in.

1. On the **Stacks** page, select the stack name. CloudFormation displays the stack details for the selected stack.

1. Choose the **Events** tab to view the stack events CloudFormation has generated for your stack.

1. Events are automatically grouped by operation ID. Each operation appears as an expandable section showing the operation type, status, and timestamp.

1. Click on an **operation ID** to open a detailed view showing only the events related to that specific operation.

1. In the operation detail view, select the **Display failures only** checkbox to display only failed events for root cause analysis.

CloudFormation automatically refreshes the stack events every minute. The **New events available** badge appears when new stack events occur. Choose the refresh icon to load these events into the list.

By viewing stack events grouped by operation, you can understand the sequence of events for each operation and quickly identify which specific operation caused issues (if you are debugging your stack).

While your stack operation is running, it's listed with a status of `CREATE_IN_PROGRESS`, `UPDATE_IN_PROGRESS`, or `DELETE_IN_PROGRESS`. After your operation has completed successfully, its status changes to `CREATE_COMPLETE`, `UPDATE_COMPLETE`, or `DELETE_COMPLETE`.

For more information, see [Understand CloudFormation stack creation events](stack-resource-configuration-complete.md) and [Monitor the progress of a stack update](using-cfn-updating-stacks-monitor-stack.md).

## View stack events by operation (AWS CLI)
<a name="view-stack-events-by-operation-cli"></a>

You can use the `describe-events` command with operation ID filtering to view events for specific operations.

### Get last operation IDs
<a name="get-last-operation-ids"></a>

The stack description available via describe-stacks API now includes LastOperations information showing recent operation IDs and their types. This enables you to quickly identify which operations occurred and their current status without parsing through event logs.

```
aws cloudformation describe-stacks --stack-name MyStack
```

The following is an example response showing the last operation was a Rollback following a failed Update operation.

```
{  
    "Stacks": [  
        {  
            "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/MyStack/07580010-bb79-11f0-8f6c-0289bb5c804f",  
            "StackName": "MyStack",  
            "Description": "A simple CloudFormation template to create an S3 bucket.",  
            "CreationTime": "2025-11-07T01:28:13.778000+00:00",  
            "LastUpdatedTime": "2025-11-07T01:43:39.838000+00:00",  
            "RollbackConfiguration": {},  
            "StackStatus": "UPDATE_ROLLBACK_COMPLETE",  
            "DisableRollback": false,  
            "NotificationARNs": [],  
            "Tags": [],  
            "EnableTerminationProtection": false,  
            "DriftInformation": {  
                "StackDriftStatus": "NOT_CHECKED"  
            },  
            "LastOperations": [  
                {  
                    "OperationType": "ROLLBACK",  
                    "OperationId": "d0f12313-7bdb-414d-a879-828a99b36f29"  
                },  
                {  
                    "OperationType": "UPDATE_STACK",  
                    "OperationId": "1c211b5a-4538-4dc9-bfed-e07734371e57"  
                }  
            ]  
        }  
    ]  
}
```

### Filter events by operation ID
<a name="filter-events-by-operation-id"></a>

The following `describe-events` command describes events for a specific operation ID:

```
aws cloudformation describe-events \
  --operation-id 1c211b5a-4538-4dc9-bfed-e07734371e57
```

To view only failed events for troubleshooting, use the `--filter FailedEvents=true` parameter:

```
aws cloudformation describe-events \
  --operation-id 1c211b5a-4538-4dc9-bfed-e07734371e57 \
  --filter FailedEvents=true
```

The new operation ID filtering capability allows you to focus on specific operations and their related events. This is particularly useful for:
+ **Troubleshooting specific failures:** Isolate events from a failed operation to understand what went wrong.
+ **Monitoring long-running operations:** Track progress of complex updates or large stack deployments.
+ **Auditing changes:** Review all events associated with a particular update operation.
+ **Root cause analysis:** Use the failure filter to quickly identify the source of deployment issues.

## Stack status codes
<a name="stack-status-codes"></a>

The following table describes the fields returned by the `describe-events` command when using operation ID filtering:


| Field | Description | 
| --- | --- | 
| EventId | Event identifier. | 
| OperationId | Unique identifier for the operation that generated this event. | 
| StackName | Name of the stack that the event corresponds to. | 
| StackId | Identifier of the stack that the event corresponds to. | 
| LogicalResourceId | Logical identifier of the resource. | 
| PhysicalResourceId | Physical identifier of the resource. | 
| ResourceProperties | Properties of the resource. | 
| ResourceType | Type of the resource. | 
| Timestamp | Time when the event occurred. | 
| ResourceStatus | The status of the resource (CREATE\$1COMPLETE, UPDATE\$1FAILED, etc.). | 
| DetailedStatus | The detailed status of the stack. If CONFIGURATION\$1COMPLETE is present, the stack resources configuration phase has completed and the stabilization of the resources is in progress. | 
| ResourceStatusReason | More information on the status. | 

# View a timeline of a CloudFormation stack deployment
<a name="stack-deployment-timeline-graph"></a>

The stack deployment timeline graph provides a visual representation of a stack deployment timeline. This view shows the deployment statuses for the stack and each of its resources, and the times that each status changed. Stack deployment statuses are represented by a corresponding color.

**Topics**
+ [

## Understanding the stack deployment timeline graph
](#understanding-stack-deployment-timeline-graph)
+ [

## Viewing the stack deployment timeline graph (console)
](#viewing-stack-deployment-timeline-graph)

## Understanding the stack deployment timeline graph
<a name="understanding-stack-deployment-timeline-graph"></a>

The following image shows the timeline graph for a stack deployment that failed due to an Amazon EC2 instance resource that failed to launch.

![\[A stack deployment timeline graph for a failed stack deployment.\]](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/images/deployment-timeline-graph.PNG)


The names of the stack resources are found on the left side of the graph, and the date and time relative to the deployment times are found at the top of the graph.

Each resource starts with the **In progress** status. The status bar changes to **Complete** for each successful deployment. The status bar changes to **Failed** when a resource fails to deploy. When a resource fails to deploy and the stack deployment also fails, the resource responsible for the stack deployment failure receives the **Likely root failure** status.

After the stack deployment operation failed, the successfully deployed resource begin rolling back and change to the **Rollback in progress** status. The statuses change to **Rollback complete** after the resource finish rolling back.

Choosing each resource provides more granular detail on the deployment timeline:

![\[A stack deployment timeline graph popover showing deployment details for the chosen failed resource.\]](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/images/deployment-timeline-graph-root-cause.PNG)


Choosing a resource shows the **Type**, deployment **Start time**, deployment **End time**, and **Total duration** of the deployment. You will also find the **Start time**, **End time**, and **Duration** of each deployment status in the drop-down menus below. If the resource failed to deploy, a **Failure reason** will be provided.

For more information on stack statuses, see [Stack status codes](view-stack-events.md#cfn-console-view-stack-data-resources-status-codes).

## Viewing the stack deployment timeline graph (console)
<a name="viewing-stack-deployment-timeline-graph"></a>

To view a stack deployment timeline graph:

1. Open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).

1. On the navigation bar at the top of the screen, choose the AWS Region you created the stack in.

1. On the **Stacks** page of the CloudFormation console, choose the stack name. CloudFormation displays the stack details for the selected stack.

1. Choose the **Events** tab to view the stack events CloudFormation has generated for your stack. 

1. Choose the **Timeline graph** button to view the timeline graph for your stack. 

# Understand CloudFormation stack creation events
<a name="stack-resource-configuration-complete"></a>

During stack deployment, several events occur to create, configure, and validate the resources defined in the stack template. Understanding these events can help you optimize your stack creation process and streamline deployments.
+ **Resource creation events** – When each resource starts the creation process, a **Status** of `CREATE_IN_PROGRESS` event is set. This event indicates that the resource is being provisioned.
+ **Eventual consistency check** – A significant portion of the stack creation time is spent performing an eventual consistency check against the resources created by the stack. During this phase, the service performs internal consistency checks, ensuring the resource is fully operational and meets service stabilization criteria defined by each AWS service.
+ **Configuration complete event** – When each resource has finished the eventual consistency check phase of the provisioning, a ** Detailed status** of `CONFIGURATION_COMPLETE` event is set.
+ **Resource creation complete event** – After the resource has been created and configured as specified, and the configuration matches what is specified in the template, the **Status** of `CREATE_COMPLETE` event is set.

You can leverage the `CONFIGURATION_COMPLETE` event to streamline your stack creation process in scenarios where resource eventual consistency check is not required, such as validating a pre-production stack configuration or cross-stack provisioning. You can use this event in multiple ways. For example, you can use it as a visual signal to skip waiting for the resource or stack consistency check to finish. Or you could use it to create an automated mechanism using continuous integration and continuous delivery (CI/CD) to trigger additional actions.

**Important**  
While leveraging the `CONFIGURATION_COMPLETE` event accelerates stack creation times, you should be aware of its trade-offs. First, it's only supported for a subset of resource type that support drift detection. For a list of resource types that support drift detection, see [Resource type support](resource-import-supported-resources.md). This approach may not be suitable for all scenarios, especially where resources require thorough eventual consistency checks to ensure full operational readiness across the cloud environment (for example, in production environments). We recommend carefully assessing your deployment requirements and the criticality of the consistency checks for each resource. Use the `CONFIGURATION_COMPLETE` event to optimize deployment speeds without compromising the integrity and reliability of your infrastructure.   
Because the `CONFIGURATION_COMPLETE` event is not guaranteed to be set, any scenarios that use it should be prepared to handle a `CREATE_COMPLETE` event when no `CONFIGURATION_COMPLETE` event was set.

![\[Diagram showing the sequence of events for resource creation and eventual consistency check in a stack.\]](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/images/configuration-complete.png)


When the stack deployment starts, both the `AWS::ECR::Repository` and `AWS::ECS::Cluster` resources start the creation process (`ResourceStatus` = `CREATE_IN_PROGRESS`. When the `AWS::ECR::Repository` resource type has started the eventual consistency check (`DetailedStatus` = `CONFIGURATION_COMPLETE`), then the `AWS::ECS::TaskDefinition` resource can start the creation process. Similarly, once the `AWS::ECS::TaskDefinition` resource begins the eventual consistency check, the `AWS::ECS::Service` resource start the creation process.

**`CREATE_IN_PROGRESS` and `CREATE_COMPLETE` events**
+ **[Stack]:** `CREATE_IN_PROGRESS`
+ **[Resource]:** ECR Repository `CREATE_IN_PROGRESS`
+ **[Resource]:** ECS Cluster `CREATE_IN_PROGRESS`
+ **[Resource]:** ECR Repository `CREATE_IN_PROGRESS`, `CONFIGURATION_COMPLETE`
+ **[Resource]:** ECS Task Definition `CREATE_IN_PROGRESS`
+ **[Resource]:** ECS Cluster `CREATE_IN_PROGRESS`, `CONFIGURATION_COMPLETE`
+ **[Resource]:** ECS Task Definition `CREATE_IN_PROGRESS`, `CONFIGURATION_COMPLETE`
+ **[Resource]:** ECS Service `CREATE_IN_PROGRESS`
+ **[Resource]:** ECR Repository `CREATE_COMPLETE`
+ **[Resource]:** ECS Cluster `CREATE_COMPLETE`
+ **[Resource]:** ECS Service `CREATE_IN_PROGRESS`, `CONFIGURATION_COMPLETE`
+ **[Stack]:** `CREATE_IN_PROGRESS`, `CONFIGURATION_COMPLETE`
+ **[Resource]:** ECS Task Definition `CREATE_COMPLETE`
+ **[Resource]:** ECS Service `CREATE_COMPLETE`
+ **[Stack]:** `CREATE_COMPLETE`

# Monitor the progress of a stack update
<a name="using-cfn-updating-stacks-monitor-stack"></a>

You can monitor the progress of a stack update by viewing the stack's events. The stack's **Events** tab displays each major step in the creation and update of the stack sorted by the time of each event with latest events on top. For more information, see [Monitor stack progress](monitor-stack-progress.md).

**Topics**
+ [

## Events generated during a successful stack update
](#using-cfn-updating-stacks-monitor-stack-update-events)
+ [

## Events generated when a resource update fails
](#using-cfn-updating-stacks-monitor-stack-update-failure)

## Events generated during a successful stack update
<a name="using-cfn-updating-stacks-monitor-stack-update-events"></a>

The start of the stack update process is marked with an `UPDATE_IN_PROGRESS` event for the stack:

```
2011-09-30 09:35 PDT AWS::CloudFormation::Stack MyStack UPDATE_IN_PROGRESS 
```

Next are events that mark the beginning and completion of the update of each resource that was changed in the update template. For example, updating an [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-rds-dbinstance.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-rds-dbinstance.html) resource named `MyDB` would result in the following entries:

```
2011-09-30 09:35 PDT AWS::RDS::DBInstance MyDB UPDATE_COMPLETE
2011-09-30 09:35 PDT AWS::RDS::DBInstance MyDB UPDATE_IN_PROGRESS
```

The `UPDATE_IN_PROGRESS` event is logged when CloudFormation reports that it has begun to update the resource. The `UPDATE_COMPLETE` event is logged when the resource is successfully created.

When CloudFormation has successfully updated the stack, you will see the following event:

```
2011-09-30 09:35 PDT AWS::CloudFormation::Stack MyStack UPDATE_COMPLETE 
```

**Important**  
During stack update operations, if CloudFormation needs to replace an existing resource, it first creates a new resource and then deletes the old resource. However, there may be cases where CloudFormation can't delete the old resource (for example, if the user doesn't have permissions to delete a resource of a given type).  
CloudFormation makes three attempts at deleting the old resource. If CloudFormation can't delete the old resource, it removes the old resource from the stack and continues updating the stack. When the stack update is complete, CloudFormation issues an `UPDATE_COMPLETE` stack event, but includes a `StatusReason` that states that one or more resources couldn't be deleted. CloudFormation also issues a `DELETE_FAILED` event for the specific resource, with a corresponding `StatusReason` providing more detail on why CloudFormation failed to delete the resource.  
The old resource still exists and will continue to incur charges, but is no longer accessible through CloudFormation. To delete the old resource, access the old resource directly using the console or API for the underlying service.  
This is also true for resources that you have removed from the stack template, and so will be deleted from the stack during the stack update.

## Events generated when a resource update fails
<a name="using-cfn-updating-stacks-monitor-stack-update-failure"></a>

If an update of a resource fails, CloudFormation reports an `UPDATE_FAILED` event that includes a reason for the failure. For example, if your update template specified a property change that's not supported by the resource such as reducing the size of `AllocatedStorage` for an [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-rds-dbinstance.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-rds-dbinstance.html) resource, you would see events like these:

```
2011-09-30 09:36 PDT AWS::RDS::DBInstance MyDB UPDATE_FAILED Size cannot be less than current size; requested: 5; current: 10
2011-09-30 09:35 PDT AWS::RDS::DBInstance MyDB UPDATE_IN_PROGRESS
```

If a resource update fails, CloudFormation rolls back any resources that it has updated during the upgrade to their configurations before the update. Here is an example of the events you would see during an update rollback:

```
2011-09-30 09:38 PDT AWS::CloudFormation::Stack MyStack UPDATE_ROLLBACK_COMPLETE
2011-09-30 09:38 PDT AWS::RDS::DBInstance MyDB UPDATE_COMPLETE
2011-09-30 09:37 PDT AWS::RDS::DBInstance MyDB UPDATE_IN_PROGRESS
2011-09-30 09:37 PDT AWS::CloudFormation::Stack MyStack UPDATE_ROLLBACK_IN_PROGRESS The following resource(s) failed to update: [MyDB]
```

# Continue rolling back an update
<a name="using-cfn-updating-stacks-continueupdaterollback"></a>

Sometimes, when CloudFormation tries to roll back a stack update, it can't roll back all the changes it made during the update process. This is called the `UPDATE_ROLLBACK_FAILED` state. For example, you might have a stack that begins to roll back to an old database instance that was deleted outside of CloudFormation. Because CloudFormation doesn't know that the database was deleted, it assumes that the database instance still exists and attempts to roll back to it, causing the update rollback to fail.

A stack in the `UPDATE_ROLLBACK_FAILED` state can't be updated, but it can be rolled back to a working state (`UPDATE_ROLLBACK_COMPLETE`). After returning the stack to its original settings, you can try to update it again.

In most cases, you must fix the error that causes the update rollback to fail before you can continue to roll back your stack. In other cases, you can continue to roll back the update without any changes, for example when a stack operation times out.

**Note**  
If you use nested stacks, rolling back the parent stack will attempt to roll back all the child stacks as well.

**To continue rolling back an update (console)**

1. Sign in to the AWS Management Console and open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).

1. On the navigation bar at the top of the screen, choose the AWS Region where the stack is located.

1. On the **Stacks** page, choose the stack that you want to update, choose **Stack actions**, and then choose **Continue update rollback**.

   If none of the solutions in the [Troubleshooting errors](troubleshooting.md#troubleshooting-errors) worked, you can use the advanced option to skip the resources that CloudFormation can't successfully roll back. You must [look up](cfn-console-view-stack-data-resources.md) and type the logical IDs of the resources that you want to skip. Specify only resources that went into the `UPDATE_FAILED` state during the `UpdateRollback` and not during the forward update.
**Warning**  
CloudFormation sets the status of the specified resources to `UPDATE_COMPLETE` and continues to roll back the stack. After the rollback is complete, the state of the skipped resources will be inconsistent with the state of the resources in the stack template. Before performing another stack update, you must update the stack or resources to be consistent with each other. If you don't, subsequent stack updates might fail, and the stack will become unrecoverable.

   Specify the minimum number of resources required to successfully roll back your stack. For example, a failed resource update might cause dependent resources to fail. In this case, it might not be necessary to skip the dependent resources.

   To skip resources that are part of nested stacks, use the following format: `NestedStackName.ResourceLogicalID`. If you want to specify the logical ID of a stack resource (`Type: AWS::CloudFormation::Stack`) in the `ResourcesToSkip` list, then its corresponding embedded stack must be in one of the following states: `DELETE_IN_PROGRESS`, `DELETE_COMPLETE`, or `DELETE_FAILED`.

**To continue rolling back an update (AWS CLI)**
+ Use the [https://docs.aws.amazon.com/cli/latest/reference/cloudformation/continue-update-rollback.html](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/continue-update-rollback.html) command with the `--stack-name` option to specify the ID of the stack that you want to continue to roll back.

## Continue rolling back from failed nested stack updates
<a name="nested-stacks"></a>

When you have multiple stacks nested within each other, you may need to skip resources across multiple nested levels to get the full stack hierarchy back to a working state. 

For example, you have a root stack called `WebInfra` that contains two smaller stacks inside it: `WebInfra-Compute` and `WebInfra-Storage`. These two stacks also have their own nested stacks within them.

If something goes wrong during an update, and the update process fails, the entire stack hierarchy may end up in the `UPDATE_ROLLBACK_FAILED` state, as shown in the following diagram. 

![\[A diagram showing a three-level nested stack hierarchy.\]](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/images/cfn-update-stack-continue-update-rollback_nested-stacks.png)


**Note**  
The stack names in this example are truncated for simplicity. Child stack names are typically generated by CloudFormation and contain unique random strings, so actual names might not be user-friendly.

To get the root stack into an operable state using the `continue-update-rollback` command, you must use the `--resources-to-skip` option to skip resources that failed to rollback.

The following **continue-update-rollback** example resumes a rollback operation from a previously failed stack update. In this example, the `--resources-to-skip` option includes the following items:
+ `myCustom`
+ `WebInfra-Compute-Asg.myAsg`
+ `WebInfra-Compute-LB.myLoadBalancer`
+ `WebInfra-Storage.DB`

For the resources of the root stack, you only need to provide the logical ID, for example, `myCustom`. However, for the resources that are contained in nested stacks, you must provide both the nested stack name and its logical ID, separated by a period. For example, `WebInfra-Compute-Asg.myAsg`.

```
aws cloudformation continue-update-rollback --stack-name WebInfra \
    --resources-to-skip myCustom WebInfra-Compute-Asg.myAsg WebInfra-Compute-LB.myLoadBalancer WebInfra-Storage.DB
```

**To find the stack name of a nested stack**  
You can locate it within the child stack's stack ID or Amazon Resource Name (ARN).

The following ARN example refers to a stack named `WebInfra-Storage-Z2VKC706XKXT`.

```
arn:aws:cloudformation:us-east-1:123456789012:stack/WebInfra-Storage-Z2VKC706XKXT/ea9e7f90-54f7-11e6-a032-028f3d2330bd
```

**To find the logical ID of a nested stack**  
You can find a child stack's logical ID in the template definition of its parent. In the diagram, the `LogicalId` of the `WebInfra-Storage-DB` child stack is `DB` in its parent `WebInfra-Storage`.

In the CloudFormation console, you can also find the logical ID in the **Logical ID** column for the stack resource on the **Resources** tab or the **Events** tab. For more information, see [View stack information from the CloudFormation console](cfn-console-view-stack-data-resources.md).

# Determine the cause of a stack failure
<a name="determine-root-cause-for-stack-failures"></a>

If your stack creation fails, CloudFormation can help you to determine the event that is likely the root cause for the stack failure. Depending on the scenario and your permissions, AWS CloudTrail events may be able to provide further details about the root cause in case the provided **Status reason** in **Events** is not clear.

**To determine the root cause of a stack failure**

1. Open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).

1. On the **Stacks** page, choose the failed stack.

1. Choose the **Events** tab.

1. Choose **Detect root cause**. CloudFormation will analyze the failure and indicate the event that is the likely the cause for the failure by adding a **Likely root cause** label to the specific event **Status**. See **Status reason** for further explanation of the status in the CloudFormation console.

1. Choose the failed **Status** with the **Likely root cause** label to learn more about the cause of the failure. Depending on the scenario and your permissions, you may be able to review a detailed CloudTrail event. These are the following potential outcomes of choosing the **Status**
   + CloudTrail events related to this issue are available and may help with resolution. View CloudTrail events.
   + We couldn't find any CloudTrail events related to this issue that could help with resolution.
   + Your current permissions do not allow access to view CloudTrail events. Learn more.
   + In the process of checking for available CloudTrail events, check back in a few minutes.
   + An error occurred while fetching the CloudTrail events. For manual inspection, visit the CloudTrail console.

1. If the provided reason in **Status reason** isn't clear, and the root cause displays a link to the CloudTrail console, open the link to view the event to find a detailed root cause.

For more information on CloudTrail events, see [Understanding CloudTrail events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-events.html) and [CloudTrail record contents](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-record-contents.html).

For more information on CloudTrail event history, see [Working with CloudTrail Event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html).

**Note**  
Nested stacks don't support **Detect root cause**.

# Choose how to handle failures when provisioning resources
<a name="stack-failure-options"></a>

If your stack operation fails, you don't have to roll back resources that were already successfully provisioned and start over from the beginning every time. Instead, you can troubleshoot resources in a `CREATE_FAILED` or `UPDATE_FAILED` status, and then resume provisioning from the point where the problem occurred. 

To do this, you must enable the preserve successfully provisioned resources option. This option is available for all stack deployments and change set operations.
+ For stack creation, if you choose the **Preserve successfully provisioned resources** option, CloudFormation preserves the state of resources that were successfully created and leaves the failed ones in a failed state until the next update operation is performed.
+ During update and change set operations, choosing **Preserve successfully provisioned resources** preserves the state of successful resources while rolling back failed resources to their last known stable state. Failed resources will be in an `UPDATE_FAILED` state. Resources without a last known stable state will be deleted upon the next stack operation.

**Topics**
+ [

## Overview of stack failure options
](#stack-failure-options-overview)
+ [

## Required conditions for pausing stack rollback
](#stack-failure-options-conditions)
+ [

## Preserve successfully provisioned resources (console)
](#stack-failure-options-console)
+ [

## Preserve successfully provisioned resources (AWS CLI)
](#stack-failure-options-cli)

## Overview of stack failure options
<a name="stack-failure-options-overview"></a>

Before issuing an operation from the CloudFormation console, API, or AWS CLI, specify the behavior for provisioned resource failure. Then, proceed with the deployment process of your resources without any other modifications. In the event of an operational failure, CloudFormation stops at the first failure in each independent provisioning path. CloudFormation identifies dependencies between resources to parallelize independent provisioning actions. Then it proceeds to provision resources on each independent provisioning path until it encounters a failure. A failure in one path doesn’t affect other provisioning paths. CloudFormation will continue to provision the resources until completion or stop on a different failure.

Remediate any issues to continue the deployment process. CloudFormation performs the necessary updates before retrying provisioning actions on resources that couldn’t be successfully provisioned earlier. You remediate issues by submitting a **Retry**, **Update**, or **Roll back** operations. For example, if you're provisioning an Amazon EC2 instance and the EC2 instance fails during a create operation, you might want to investigate the error, rather than rolling back the failed resource right away. You can review system status checks and instances status checks, and then select the **Retry** operation once the issues is resolved.

When a stack operation fails, and you've specified **Preserve successfully provisioned resources** from the **Stack failure options** menu, you can select the following options.
+ **Retry** – Retries provisioning operation on failed resources and continues provisioning the template until the successful completion of the stack operation or the next failure. Select this option if the resource failed to provision due to an issue that doesn't require template modifications, such as an AWS Identity and Access Management (IAM) permission.
+ **Update** – Resources that have been provisioned are updated on template updates. Resources that failed to create or update will be retried. Select this option if the resource failed to provision due to template errors, and you've modified the template. When you update a stack that's in a `FAILED` state, you must select **Preserve successfully provisioned resources** for the **Stack failure options** to continue updating your stack.
+ **Roll back** – CloudFormation rolls back the stack to the last known stable state.

## Required conditions for pausing stack rollback
<a name="stack-failure-options-conditions"></a>

To prevent CloudFormation from automatically rolling back and deleting the resources that were successfully created, the following conditions must be met.

1. When you create or update the stack, you must choose the option to **Preserve successfully provisioned resources**. This tells CloudFormation not to delete the resources that were created successfully, even if the overall stack operation fails.

1. The stack operation must have failed, meaning the stack status is either `CREATE_FAILED` or `UPDATE_FAILED`.

**Note**  
Immutable update types aren't supported.

## Preserve successfully provisioned resources (console)
<a name="stack-failure-options-console"></a>

------
#### [ Create stack ]

**To preserve successfully provisioned resources during a create stack operation**

1. Sign in to the AWS Management Console and open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).

1. From the **Stacks** page, choose **Create stack** at top right, and then choose **With new resources (standard)**.

1. For **Prerequisite - Prepare template**, choose **Choose an existing template**.

1. Under **Specify template**, choose to either specify the URL for the S3 bucket that contains your stack template or upload a stack template file. Then, choose **Next**.

1. On the **Specify stack details** page, enter a stack name in the **Stack name** box.

1. In the **Parameters** section, specify parameters that are defined in your stack template.

   You can use or change any parameters with default values.

1. When you're satisfied with the parameter values, choose **Next**.

1. On the **Configure stack options** page, you can set additional options for your stack.

1. For **Stack failure options**, select **Preserve successfully provisioned resources**.

1. When you're satisfied with the stack options, choose **Next**.

1. Review your stack on the **Review** page and select **Create stack**.

*Results*: Resources that failed to create transition the stack status to `CREATE_FAILED` to prevent the stack from rolling back when the stack operation encounters a failure. Resources that are successfully provisioned are in a `CREATE_COMPLETE` state. You can monitor the stack in the **Stack events** tab.

------
#### [ Update stack ]

**To preserve successfully provisioned resources during an update stack operation**

1. Sign in to the AWS Management Console and open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).

1. Select the stack you want to update and then choose **Update**.

1. On the **Update stack** page, choose a stack template by using one of the following options:
   + **Use existing template**
   + **Replace current template**
   + **Edit template in Infrastructure Composer**

   Accept your settings and select **Next**.

1. On the **Specify stack details** page, specify parameters that are defined in your stack template.

   You can use or change any parameters with default values.

1. When you're satisfied with the parameter values, choose **Next**.

1. On the **Configure stack options** page, you can set additional options for your stack.

1. For the **Behavior on provisioning failure**, select **Preserve successfully provisioned resources**.

1. When you're satisfied with the stack options, choose **Next**.

1. Review your stack on the **Review** page and select **Update stack**.

*Results*: Resources that failed to update transition the stack status to `UPDATE_FAILED` and roll back to the last known stable state. Resources without a last known stable state will be deleted by CloudFormation upon the next stack operation. Resources that are successfully provisioned are in a `CREATE_COMPLETE` or `UPDATE_COMPLETE` state. You can monitor the stack in the **Stack events** tab.

------
#### [ Change set ]

**Note**  
You can initiate a change set for a stack with a status of `CREATE_FAILED` or `UPDATE_FAILED`, but not for a status of `UPDATE_ROLLBACK_FAILED`.

**To Preserve successfully provisioned resources during a change set operation**

1. Sign in to the AWS Management Console and open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).

1. Select the stack that contains the change set you want to initiate, and then choose the **Change sets** tab.

1. Select the change set and then choose **Execute**.

1. For **Execute change set**, select the **Preserve successfully provisioned resources** option.

1. Select **Execute change set**.

*Results*: Resources that failed to update transition the stack status to `UPDATE_FAILED` and roll back to the last known stable state. Resources without a last known stable state will be deleted by CloudFormation upon the next stack operation. Resources that are successfully provisioned are in a `CREATE_COMPLETE` or `UPDATE_COMPLETE` state. You can monitor the stack in the **Stack events** tab.

------

## Preserve successfully provisioned resources (AWS CLI)
<a name="stack-failure-options-cli"></a>

------
#### [ Create stack ]

**To preserve successfully provisioned resources during a stack create operation**

Specify the `--disable-rollback` option or `on-failure DO_NOTHING` enumeration during a [create-stack](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/create-stack.html) operation.

1. Provide a stack name and template to the **create-stack** command with the `--disable-rollback` option.

   ```
   aws cloudformation create-stack --stack-name myteststack \
       --template-body file://template.yaml \
       --disable-rollback
   ```

   The command returns the following output.

   ```
   {
       "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896"
   }
   ```

1. Describe the state of the stack using the **describe-stacks** command.

   ```
   aws cloudformation describe-stacks --stack-name myteststack
   ```

   The command returns the following output.

   ```
   {
       "Stacks":  [
           {
               "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896",
               "Description": "AWS CloudFormation Sample Template",
               "Tags": [],
               "Outputs": [],
               "StackStatusReason": “The following resource(s) failed to create: [MyBucket]”,
               "CreationTime": "2013-08-23T01:02:15.422Z",
               "Capabilities": [],
               "StackName": "myteststack",
               "StackStatus": "CREATE_FAILED",
               "DisableRollback": true
           }
       ]
   }
   ```

------
#### [ Update stack ]

**To preserve successfully provisioned resources during a stack update operation**

1. Provide an existing stack name and template to the **update-stack** command with the `--disable-rollback` option.

   ```
   aws cloudformation update-stack --stack-name myteststack \
       --template-url https://s3.amazonaws.com/amzn-s3-demo-bucket/updated.template --disable-rollback
   ```

   The command returns the following output.

   ```
   {
       "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896"
   }
   ```

1. Describe the state of the stack using either the **describe-stacks** or **describe-stack-events** command.

   ```
   aws cloudformation describe-stacks --stack-name myteststack
   ```

   The command returns the following output.

   ```
   {
       "Stacks":  [
           {
               "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896",
               "Description": "AWS CloudFormation Sample Template",
               "Tags": [],
               "Outputs": [],
               "CreationTime": "2013-08-23T01:02:15.422Z",
               "Capabilities": [],
               "StackName": "myteststack",
               "StackStatus": "UPDATE_COMPLETE",
               "DisableRollback": true
           }
       ]
   }
   ```

------
#### [ Change set ]

**Note**  
You can initiate a change set for a stack with a status of `CREATE_FAILED` or `UPDATE_FAILED` but not for a status of `UPDATE_ROLLBACK_FAILED`.

**To preserve successfully provisioned resources during a change set operation**

Specify the `--disable-rollback` option during an [execute-change-set](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/execute-change-set.html) operation.

1. Provide a stack name and template to the **execute-change-set** command with the `--disable-rollback` option.

   ```
   aws cloudformation execute-change-set --stack-name myteststack \
       --change-set-name my-change-set --template-body file://template.yaml
   ```

   The command returns the following output.

   ```
   {
    "Id": "arn:aws:cloudformation:us-east-1:123456789012:changeSet/my-change-set/bc9555ba-a949-xmpl-bfb8-f41d04ec5784",
    "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896"
   }
   ```

1. Initiate the change set with `--disable-rollback` option.

   ```
   aws cloudformation execute-change-set --stack-name myteststack \
       --change-set-name my-change-set -–disable-rollback
   ```

1. Determine the status of the stack using either the **describe-stacks** or **describe-stack-events** command.

   ```
   aws cloudformation describe-stack-events --stack-name myteststack
   ```

   The command returns the following output.

   ```
   {
      "StackEvents": [
        {
           "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896",
           "EventId": "49c966a0-7b74-11ea-8071-024244bb0672",
           "StackName": "myteststack",
           "LogicalResourceId": " MyBucket",
           "PhysicalResourceId": "myteststack-MyBucket-abcdefghijk1",
           "ResourceType": "AWS::S3::Bucket",
           "Timestamp": "2020-04-10T21:43:17.015Z",
           "ResourceStatus": "UPDATE_FAILED"
           "ResourceStatusReason": "User XYZ is not allowed to perform S3::UpdateBucket on MyBucket"
        }
   }
   ```

1. Fix permissions errors and retry the operation.

   ```
   aws cloudformation update-stack --stack-name myteststack \
       --use-previous-template --disable-rollback
   ```

   The command returns the following output.

   ```
   {
       "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896"
   }
   ```

1. Describe the state of the stack using either the **describe-stacks** or **describe-stack-events** command.

   ```
   aws cloudformation describe-stacks --stack-name myteststack
   ```

   The command returns the following output.

   ```
   {
       "Stacks":  [
           {
               "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896",
               "Description": "AWS CloudFormation Sample Template",
               "Tags": [],
               "Outputs": [],
               "CreationTime": "2013-08-23T01:02:15.422Z",
               "Capabilities": [],
               "StackName": "myteststack",
               "StackStatus": "UPDATE_COMPLETE",
               "DisableRollback": true
           }
       ]
   }
   ```

------

### Rolling back a stack
<a name="roll-back-stack-cli"></a>

You can use the [rollback-stack](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/rollback-stack.html) command to roll back a stack with a `CREATE_FAILED` or `UPDATE_FAILED` stack status to its last stable state.

The following **rollback-stack** command rolls back the specified stack.

```
aws cloudformation rollback-stack --stack-name myteststack
```

The command returns the following output.

```
{
    "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896"
}
```

**Note**  
The **rollback-stack** operation will delete a stack if it doesn't contain a last known stable state.