CloudFormation Change Sets

CloudFormation Change Sets

CloudFormation Change Sets

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed CloudFormation Exports.

https://cloudaffaire.com/cloudformation-stack-export/

In this blog post, we are going to discuss change sets in cloudformation stack.

CloudFormation Change Sets:

When you need to update a stack, understanding how your changes will affect running resources before you implement them can help you update stacks with confidence. Change sets allow you to preview how proposed changes to a stack might impact your running resources, for example, whether your changes will delete or replace any critical resources, AWS CloudFormation makes the changes to your stack only when you decide to execute the change set, allowing you to decide whether to proceed with your proposed changes or explore other changes by creating another change set.

Note: Change sets don’t indicate whether AWS CloudFormation will successfully update a stack.

Next, we are going to create a change set of a stack.

Step 1: Login to AWS console and navigate to ‘CloudFormation’.

CloudFormation Change Sets

Step 2: Create a stack named ‘mySTACK’ with below YAML code.

Or you can use change_set_demo_v1.yaml from below GitHub repo.

https://github.com/CloudAffaire/CloudFormation

CloudFormation Change Sets

Note: To shorten the code AMI id in the above has been explicitly given for MUMBAI region, create the stack in MUMBAI region only.

Next, we are going to create a change set for the stack ‘mySTACK’.

Step 3: Click ‘Create change set’ located under ‘Change sets’.

CloudFormation Change Sets

Step 4: Upload change set template using below YAML code and click ‘Next’.

Or you can use change_set_demo_v2.yaml from below GitHub repo.

https://github.com/CloudAffaire/CloudFormation

CloudFormation Change Sets

Leave rest of the configurations as it is and click ‘Create change set’.

CloudFormation Change Sets

Our change set successfully created. You can view the proposed changes in JSON format under ‘JSON changes’ tab of change set.

Note: We are changing the instance tag in this change set which is an online operation, hence no resource recreation is required for this change.

CloudFormation Change Sets

Note: Until and unless we execute the change set by clicking ‘Execute’ no changes will be made to the actual AWS infrastructure.

Step 5: Click ‘Execute’ to make the changes effective.

CloudFormation Change Sets

CloudFormation Change Sets

Step 6: Cleanup.

CloudFormation Change Sets

Hope you have enjoyed this article. In the next blog post, we will discuss CloudFormer.

To get more details on CloudFormation, please refer below AWS documentation

https://docs.aws.amazon.com/cloudformation/index.html

 

Leave a Reply

Close Menu