AWS CFN: Update behaviors

Amazon CloudFormation (AWS CFN) is a tool that allows you to set up your resources and saves time by automating tasks. You can create a template where you describe all the AWS services you want to automate and CFN will help in provisioning and configuring those services for you.

Now, there is one of the important properties of AWS CFN i.e. update requires. To use this property, you first need to have a pre-built resource that is being managed by CFN and you should have made some changes in that resource that needs to be updated by CFN.

The 3 main behaviors of Update property are:

1) Update requires: No interruption

If you set this property then there will be no interruption as the property name says. Without causing any effect on your resource, CFN will update your service but not replace it.

2) Update requires: Some interruption

Here, for instance, if you have an EC2 instance that is being managed by the CFN and you want to change the size/volume of the instance so, in that case, you would choose the Update requires: Some interruption property. Which will update the new changes and that might cause downtime to your instance (some interruptions). Once it has updated the new changes to the new resource it will work smoothly again. Here, it creates a new resource and terminates the old one.

3) Update requires: Replacement

The replacement property is being used when you want to replace your resource with the newer one. This will not create any new resource but replaces the older one. For example: If you want to change the name of the service then you will change and CFN will just update that name, the rest all the configuration setting is as it is. No changes will be done. It will just replace that resource. There is no old or new resource when applying this behavior.

For more detailed information about the properties, refer to the AWS CFN - EC2 properties Documentation.