I\'m working with a CloudFormation template that brings up as many instances as I request, and want to wait for them to finish initialising (via User Data) before the stack crea
The AutoScalingRollingUpdate policy handles rotating out an entire set of instances in an Auto Scaling group in response to changes to the underlying LaunchConfiguration
. It doesn't apply to individual changes to the number of instances in the existing group. According to the UpdatePolicy Attribute documentation,
The
AutoScalingReplacingUpdate
andAutoScalingRollingUpdate
policies apply only when you do one or more of the following:
- Change the Auto Scaling group's
AWS::AutoScaling::LaunchConfiguration
.- Change the Auto Scaling group's
VPCZoneIdentifier
property- Update an Auto Scaling group that contains instances that don't match the current
LaunchConfiguration
.
Changing the Auto Scaling group's DesiredCapacity
property is not in this list, so the AutoScalingRollingUpdate
policy does not apply to this type of change.
As far as I know, it is not possible (using standard AWS CloudFormation resources) to delay the completion of a Stack Update modifying DesiredCapacity
until any new instances added to the Auto Scaling Group are fully provisioned.
Here are some alternative options:
DesiredCapacity
, modify a LaunchConfiguration
property at the same time. This will trigger an AutoScalingRollingUpdate
to the desired capacity (the downside is that it will also update existing instances, which may not actually need to be modified).cfn-signal
, to signal lifecycle-hook completion. This won't delay your CloudFormation stack update as desired, but it will delay the individual auto-scaled instances from entering the InService
state until the lifecycle signal is received. (See Lifecycle Hooks documentation for more info.)DesiredCapacity
number of instances all in the InService
state.