AWS CloudFormation Stack UpdatePolicy Attributes for Auto Scaling Group

Update Policy Attributes for Auto Scaling Group in AWS CloudFormation Template

Prev Question Next Question

Question

As a DevOps engineer, you use a CloudFormation stack to maintain an Auto Scaling group and a launch template.

When there is an update in the launch template, you would update the stack with the new CloudFormation template.

You need to ensure that the CloudFormation stack creates a new Auto Scaling group during the update and deletes the old Auto Scaling group during the cleanup process.

Which of the following UpdatePolicy attributes would you configure in the CloudFormation template?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: A.

Option A is CORRECT because the AutoScalingReplacingUpdate policy should be used for CloudFormation to handle replacement updates for the Auto Scaling group.

The WillReplace property needs to be true as it specifies whether the Auto Scaling group and the instances it contains are replaced during an update.

Option B is incorrect because the WillReplace property needs to be true as the above explanations.

Option C is incorrect because with the AutoScalingRollingUpdate policy, CloudFormation handles rolling updates for an Auto Scaling group.

It does not launch a new Auto Scaling group.

Option D is incorrect because the AutoScalingScheduledAction policy is used to update an associated scheduled action for an Auto Scaling group.

It does not meet the requirements of the question.

Reference:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html

The correct answer to this question is A. UpdatePolicy: AutoScalingReplacingUpdate: WillReplace: true.

When you update an Auto Scaling group in AWS CloudFormation, you can choose between several update policies. The update policy defines how CloudFormation handles the resources that are associated with the Auto Scaling group during an update.

The AutoScalingReplacingUpdate update policy is used to replace the entire Auto Scaling group, including all instances, during an update. This means that a new Auto Scaling group is created, and the old Auto Scaling group is deleted. This policy ensures that all instances are replaced with new instances that use the updated launch template.

To use the AutoScalingReplacingUpdate update policy, you need to set the WillReplace attribute to true. This attribute indicates that CloudFormation should replace the entire Auto Scaling group during the update.

Option B, UpdatePolicy: AutoScalingReplacingUpdate: WillReplace: false, is incorrect because it would not create a new Auto Scaling group during the update. Instead, it would only update the launch template of the existing Auto Scaling group.

Option C, UpdatePolicy: AutoScalingRollingUpdate: MinInstancesInService: 0, WaitOnResourceSignals: true, is incorrect because it would perform a rolling update of the Auto Scaling group. This means that CloudFormation would update the instances in the Auto Scaling group one at a time, without creating a new Auto Scaling group.

Option D, UpdatePolicy: AutoScalingScheduledAction: IgnoreUnmodifiedGroupSizeProperties: true, is incorrect because it is not a valid update policy for an Auto Scaling group in CloudFormation.

Therefore, the correct answer is A. UpdatePolicy: AutoScalingReplacingUpdate: WillReplace: true, which ensures that a new Auto Scaling group is created during the update and the old Auto Scaling group is deleted during the cleanup process.