Posted On: Jan 26, 2022

Amazon CloudFormation users can now choose to preserve the state of successfully deployed resources in the event of CloudFormation stack operation errors. Using this feature, you can retry the operation using an updated CloudFormation template and quickly iterate through feedback loops, shortening development cycles.

A common practice among developers is to create a CloudFormation template with several resources and their dependencies so they can deploy and configure them as a CloudFormation stack. Prior to this launch, failed stack operations resulted in all the CloudFormation stack resources rolling back to the last known working state, including deleting successfully created resources. For example, if a CloudFormation stack contains 10 resources and during a stack operation the last resource fails to be deployed, the default behavior would initiate rollback for all the resources, including 9 resources that were successfully deployed. With this release, you now have the option to maintain the state of the successfully created resources while you remediate the issue with the failed resources and try to provision them again. You can still elect to roll the entire CloudFormation stack back to its last known good state, as was previously the only option.

To get started, use the Amazon CloudFormation console, CLI, or Amazon SDK to specify the rollback behavior when initiating a stack operation. To learn more, please refer to documentation. This new capability in CloudFormation is available at no additional cost in Amazon Web Services China (Beijing) Region, operated by Sinnet and Amazon Web Services China (Ningxia) Region, operated by NWCD.