You currently have EC2 Instances hosting an application.
These instances are part of an Autoscaling Group created using Cloudformation.
You now want to change the instance type of the EC2 Instances.
How can you manage the deployment with the least amount of downtime?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer - B.
The AWS::AutoScaling::AutoScalingGroup resource supports an UpdatePolicy attribute.
This is used to define how an Auto Scaling group resource is updated when an update to the CloudFormation stack occurs.
A common approach to updating an Auto Scaling group is to perform a rolling update, which is done by specifying the AutoScalingRollingUpdate policy.
This retains the same Auto Scaling group and replaces old instances with new ones, according to the parameters specified.
For more information on AutoScaling Rolling Update, please refer to the below link:
https://aws.amazon.com/premiumsupport/knowledge-center/auto-scaling-group-rolling-updates/Option B is the correct answer - "Use the AutoScalingRollingUpdate policy on CloudFormation Template Auto Scaling group."
This approach enables you to update your EC2 instances with a new instance type without any downtime, using the CloudFormation template to create or update the Auto Scaling group. This is done through the use of an update policy named AutoScalingRollingUpdate.
The AutoScalingRollingUpdate policy works by launching new instances with the updated instance type and gradually terminating the old instances in batches, one at a time. The old instances are only terminated once the new instances have been successfully launched and passed health checks.
To implement this policy in your CloudFormation template, you need to specify the following parameters:
MinInstancesInService: This specifies the minimum number of instances that should be running during the update process. This is used to ensure that your application remains available during the update process.
MaxBatchSize: This specifies the maximum number of instances that should be updated at once. By default, this value is set to 1, which means that instances are updated one at a time.
PauseTime: This specifies the amount of time to wait after each instance update before proceeding to the next instance. This is used to allow your application to stabilize after the update.
WaitOnResourceSignals: This specifies whether to wait for the new instances to pass their health checks before terminating the old instances.
By setting these parameters appropriately, you can update your Auto Scaling group with the new instance type with minimal downtime and without affecting the availability of your application.