Amazon CloudFormation stack updates - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Amazon CloudFormation stack updates

When you need to make changes to a stack's settings or change its resources, you update the stack instead of deleting it and creating a new stack. For example, if you have a stack with an EC2 instance, you can update the stack to change the instance's AMI ID.

When you update a stack, you submit changes, such as new input parameter values or an updated template. Amazon CloudFormation compares the changes you submit with the current state of your stack and updates only the changed resources. For a summary of the update workflow, see How does Amazon CloudFormation work?.

Note

When updating a stack, Amazon CloudFormation might interrupt resources or replace updated resources, depending on which properties you update. For more information about resource update behaviors, see Update behaviors of stack resources.

Update methods

Amazon CloudFormation provides two methods for updating stacks: direct update or creating and executing change sets. When you directly update a stack, you submit changes and Amazon CloudFormation immediately deploys them. Use direct updates when you want to quickly deploy your updates.

With change sets, you can preview the changes Amazon CloudFormation will make to your stack, and then decide whether to apply those changes. Change sets are JSON-formatted documents that summarize the changes Amazon CloudFormation will make to a stack. Use change sets when you want to ensure that Amazon CloudFormation doesn't make unintentional changes or when you want to consider several options. For example, you can use a change set to verify that Amazon CloudFormation won't replace your stack's database instances during an update.