CloudFormation Update Behaviour - krdheeraj51/aws-labs GitHub Wiki
CloudFormation Update Behavior
When you update an AWS CloudFormation stack, CloudFormation determines how to apply the changes based on the differences between the new template and the current stack. The update behavior for each resource depends on the type of change being made. Here are the main update behaviors:
- Update with No Interruption:
CloudFormation updates the resource without disrupting its operation or changing its physical ID. Example: Updating certain properties of an AWS::CloudTrail::Trail resource.
- Update with Some Interruption:
CloudFormation updates the resource with some interruption to its operation. Example: Updating certain properties of an AWS::EC2::Instance resource might cause a brief interruption while the instance is reconfigured.
- Replacement:
CloudFormation replaces the resource by creating a new one and deleting the old one. This generates a new physical ID for the resource. Example: Updating the AvailabilityZone property of an AWS::EC2::Instance resource will trigger a replacement
Planning for Updates
When planning updates, it's important to understand the potential impact on your resources and applications. Here are some considerations:
- Snapshots and Backups: For resources that might be replaced, consider taking snapshots or backups before the update.
- Application Downtime: Plan for potential downtime or interruptions, especially for critical resources like databases.
- Resource Dependencies: Ensure that dependent resources are updated in the correct order to avoid conflicts.