Three New Features for AWS CloudFormation
AWS CloudFormation gives you an easy way to create and manage a collection of related AWS resources. You define a template (or use one of ours) and hand it over to CloudFormation. It will take care of creating all of the necessary AWS resources (a stack), in the proper order.
Today we are introducing three new features to add additional power and flexibility to CloudFormation: provisioning of EBS-Optimized Auto Scaling Groups, rolling deployments of Auto Scaling Groups, and cancellation of stack updates.
Let’s look at each one…
Provisioning EBS-Optimized EC2 Instances
EBS-Optimized EC2 instances deliver dedicated network throughput (500 Mbps or 1000 Mbps depending on the instance type) between EC2 and Amazon Elastic Block Store (EBS). You can now request EBS-Optimized EC2 instances for Auto Scaling Groups in your CloudFormation templates by using the EbsOptimized key as follows:
Rolling Deployments of Auto Scaling Groups
CloudFormation has the ability to make changes to an Auto Scaling Group (a variable sized collection of EC2 instances governed by scaling rules that allow the group to expand or contract in response to changing requirements).
Today’s new feature allows you to perform a rolling deployment of an Auto Scaling Group within a CloudFormation stack. Instead of updating all of the instances in a group at the same time, you can now replace or modify the instances in a step-by-step fashion, with control over minimum group size during the update, the number of instances to update concurrently, and a pause time between batches of updates. The information is specified in an update policy. To learn more about update policies, check out the AWS CloudFormation User Guide.
This feature will increase availability of your application during an update.
Cancellation of Stack Updates
You now have the ability to cancel a stack update that’s underway. This will interrupt the operation and trigger a rollback. The cancel operation can be used in concert with update policies to automate the cancellation and rollback of a deployment.
Here’s one way that you can us cancellations and rolling deployments together:
- Initiate a stack update using a template that includes a fairly generous pause time (perhaps as long as several minutes) between batches of concurrent upgrades.
- Wait for the first round of updates to complete.
- Validate that the new instance(s) perform as expected (this must occur within the pause time specified in the update policy).
- Cancel the update (triggering a rollback) if the validation fails.
Consult the CloudFormation User Guide to learn more about these new features.