AWS Certified Solutions Architect – Professional — Question 816

A Solutions Architect has created an AWS CloudFormation template for a three-tier application that contains an Auto Scaling group of Amazon EC2 instances running a custom AMI.
The Solutions Architect wants to ensure that future updates to the custom AMI can be deployed to a running stack by first updating the template to refer to the new
AMI, and then invoking UpdateStack to replace the EC2 instances with instances launched from the new AMI.
How can updates to the AMI be deployed to meet these requirements?

Answer options

Correct answer: C

Explanation

To replace EC2 instances in an Auto Scaling group during a CloudFormation stack update, an UpdatePolicy attribute (such as AutoScalingRollingUpdate) must be defined on the AWS::AutoScaling::AutoScalingGroup resource. Without this attribute, CloudFormation will update the launch configuration but will not automatically cycle the existing instances to use the new AMI. Changing the DeletionPolicy or executing a standard change set without an UpdatePolicy will not trigger the required rolling replacement of the running instances.