AWS CloudFormation UpdatePolicy Attributes for Auto Scaling Group | Exam DOP-C01

Auto Scaling Group UpdatePolicy Attributes in CloudFormation

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

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, we need to configure the appropriate UpdatePolicy attribute in the CloudFormation template.

Option A. UpdatePolicy: AutoScalingReplacingUpdate: WillReplace: true is the correct answer.

Explanation: AutoScalingReplacingUpdate is an UpdatePolicy attribute that creates a new Auto Scaling group and replaces the old one. When we set WillReplace to true, CloudFormation will first create a new Auto Scaling group with the updated launch template and then delete the old Auto Scaling group after the new one is created successfully.

Therefore, this option satisfies the requirement of creating a new Auto Scaling group during the update and deleting the old Auto Scaling group during the cleanup process.

Option B. UpdatePolicy: AutoScalingReplacingUpdate: WillReplace: false is incorrect.

Explanation: Setting WillReplace to false means that CloudFormation will update the existing Auto Scaling group instead of creating a new one. This option does not satisfy the requirement of creating a new Auto Scaling group during the update.

Option C. UpdatePolicy: AutoScalingRollingUpdate: MinInstancesInService: 0 WaitOnResourceSignals: true is also incorrect.

Explanation: AutoScalingRollingUpdate is an UpdatePolicy attribute that updates instances in an Auto Scaling group in batches. Setting MinInstancesInService to 0 means that all instances can be updated at once, and WaitOnResourceSignals ensures that CloudFormation waits for signals from updated instances before moving on to the next batch. However, this option does not satisfy the requirement of creating a new Auto Scaling group during the update and deleting the old Auto Scaling group during the cleanup process.

Option D. UpdatePolicy: AutoScalingScheduledAction: IgnoreUnmodifiedGroupSizeProperties: true is also incorrect.

Explanation: AutoScalingScheduledAction is an UpdatePolicy attribute that applies scheduled actions to instances in an Auto Scaling group. Setting IgnoreUnmodifiedGroupSizeProperties to true means that CloudFormation will not update the Auto Scaling group if only the scheduled actions have changed. This option does not satisfy the requirement of creating a new Auto Scaling group during the update and deleting the old Auto Scaling group during the cleanup process.

In conclusion, the correct answer is option A, which configures UpdatePolicy: AutoScalingReplacingUpdate: WillReplace: true to create a new Auto Scaling group during the update and delete the old one during the cleanup process.