Download AWS CloudFormation User Guide

Transcript
AWS CloudFormation User Guide
Stack Updates
Update with No Interruption
AWS CloudFormation updates the resource without disrupting operation of that resource and without
changing the resource's physical name. For example, if you update any properties on an
AWS::CloudWatch::Alarm (p. 334) resource, AWS CloudFormation updates the alarm's configuration
and, during the update, the alarm's operation continues without disruption.
Updates with Some Interruption
AWS CloudFormation updates the resource with some interruption but the physical name is retained.
For example, if you update certain properties on an AWS::EC2::Instance (p. 354) resource, the instance
might have some interruption while AWS CloudFormation and Amazon EC2 reconfigure the instance.
Replacement
AWS CloudFormation recreates the resource during an update, which also generates a new physical
ID. AWS CloudFormation creates the replacement resource first, changes references from other
dependent resources to point to the replacement resource, and then deletes the old resource. For
example, if you update the Engine property of an AWS::RDS::DBInstance (p. 496) resource, AWS
CloudFormation creates a new resource and replaces the current DBInstance resource with the new
one.
To learn more about updating a particular resource, see the documentation that is associated with that
resource. For example, the Amazon EC2 documentation provides details about what changes interrupt
an instance. See also the AWS Resource Types Reference (p. 286), where the effects of updating a
resource are listed for each property.
Depending on the technique AWS CloudFormation uses to modify each updated resource in your stack,
you can make decisions about when it's best to modify resources to reduce the impact of these changes
on your application. In particular, you can plan when resources must be replaced during an update. For
example, if you update the Port property of an AWS::RDS::DBInstance resource, AWS CloudFormation
creates a new DB instance with the updated port setting and a new physical name. To plan for this, you
should do the following:
1. Take a snapshot of the current databases.
2. Prepare a strategy for how applications that use that DB instance will handle an interruption while the
DB instance is being replaced.
3. Ensure that the applications that use that DB instance take into account the updated port setting and
any other updates you have made.
4. Use the DB snapshot to restore the databases on the new DB instance.
This example is not exhaustive; it's meant to give you an idea of the things to plan for when a resource
is replaced during an update.
Note
If the template includes one or more nested stacks (p. 324), AWS CloudFormation also initiates
an update for every nested stack. This is necessary to determine whether the nested stacks
have been modified. AWS CloudFormation updates only those resources in the nested stacks
that have changes specified in corresponding templates.
Topics
• Modifying a Stack Template (p. 87)
• Updating a Stack (p. 90)
• Monitoring the Progress of a Stack Update (p. 92)
• Canceling a Stack Update (p. 93)
• Prevent Updates to Stack Resources (p. 94)
API Version 2010-05-15
86