Change Sets

Get working knowledge of change sets to modify stacks in AWS CloudFormation.

Once we create a stack to provision resources, we might need to modify it. A change set provides a summary of proposed modifications to a CloudFormation stack.

In this lesson, we’ll explore a change set, when we need it, and how it is useful in updating or modifying a stack.

What is a change set?

Once we’ve created a stack, we may want to go back and update the stack to create new resources, modify some resource configurations, or just delete any resources we no longer require. This is often necessary to adapt to changing requirements, improve performance, maintain security, or optimize costs.

When updating an existing stack, CloudFormation will automatically generate a set of changes in the stack based on the modified template we provide. This set of changes is known as a change set.

Press + to interact

It’s important to note that this set of changes has not yet been implemented on the stack, and we can preview and validate any creation, modification, or removal of any AWS resources before actually implementing them into the stack.

Note: A change set is not necessarily only made during stack modification but also during stack creation. However, the change set in this case is basically just the addition of all AWS resources that are being created in the stack.

Once the stack is modified, we can still preview the previous change sets, and this can be helpful in keeping track of what changes were made in the stack.

Change sets vs. drifts

Change sets are changes in a stack that are directly made by updating the template through CloudFormation. However, when changes are made directly to the AWS resources outside of CloudFormation without updating the stack through CloudFormation itself, they are detected as drifts using the CloudFormation service.

CloudFormation also allows us to ...