

Update behavior examples on an EC2 instance These concepts can be difficult to understand at an abstract level, so let's explore it with an example. Replacement: An entirely new resource is created to replace your existing resource.

Update with some interruption: Your resource is still the same resource, but there will be some downtime as the update is applied. Update with no interruption: Your resource is updated in place without any disruption to normal use. When this happens, there are three potential behaviors for your existing resource: You are changing an attribute on the existing resource during an update to your CloudFormation stack. You have an existing resource that is managed by a CloudFormation stack and The three kinds of update behaviors with CloudFormation įirst, let's cover the three types of update behaviors in CloudFormation.įor an update behavior to be relevant, two things need to be true: Using UpdateReplace Policies to manage resources that are replaced. Using Stack Policies to prevent undesirable updates to existing resources Why you might not want the Replacement update behavior with CloudFormation The three kinds of update behaviors with CloudFormation If the piece of infrastructure in question is a database or critical EC2 instance, this can be a very unwelcome surprise!įortunately, the mechanisms for updating resources in CloudFormation are well-defined, and AWS provides a number of ways to protect against an accidental configuration error. Changing a property for an existing resource in your CloudFormation file can have drastic effects on your infrastructure, including replacing an existing piece of infrastructure by deleting the old one and creating a new one. One of the trickier aspects of CloudFormation is around its update mechanisms. You submit this configuration file to the CloudFormation service, which safely and reliably provisions your infrastructure. It allows you to describe your desired infrastructure in a configuration file, which can be checked into source control for easy review, automation, and tracking over time. AWS CloudFormation is a powerful tool for provisioning resources in AWS.
