Deploying New AMIs for Auto Scaling Group: Best Practices for Controlled Deployment

Deploying New AMIs for Auto Scaling Group

Prev Question Next Question

Question

You have a web application composed of an Auto Scaling group of web servers behind a load balancer.

For each new release, you have a new AMI for the Auto Scaling group and you need to deploy it in a controlled manner.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - B.

Option A is incorrect because you cannot modify an existing launch configuration.

Option B is CORRECT because you can attach the ASG with the new AMI in the same ELB so that you can control the deployment and rollback easily.

Option C is incorrect because you cannot attach two launch configurations in the same Auto Scaling group.

Option D is incorrect because with this option, you have to create a new Load Balancer, which is not as cost-effective as option.

B.For more information on AWS Autoscaling Launch Configurations, please visit:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig.html

The correct answer for this scenario is A. Modify the Autoscaling launch configuration with the new AMI. Use the Auto Scaling rolling updates feature to migrate to the new version.

Explanation:

Auto Scaling groups help maintain the desired number of instances, and they automatically launch or terminate instances based on conditions that you define. When it comes to updating the instances, you need to ensure that the update is carried out in a controlled manner so that the application is not impacted.

Option A is the recommended approach because it is the simplest and most reliable way to update the Auto Scaling group with the new AMI.

Here's how it works:

  1. Modify the Auto Scaling launch configuration with the new AMI.
  2. Use the Auto Scaling rolling updates feature to migrate to the new version. This feature enables you to update the instances in the Auto Scaling group incrementally, ensuring that the application remains available throughout the update process.
  3. Set the minimum number of instances to be updated in each update group. You can specify a percentage or a fixed number of instances.
  4. Set the maximum batch size for the update process. This specifies the maximum number of instances that can be updated simultaneously.
  5. Monitor the update process to ensure that it is progressing as expected. You can use CloudWatch metrics and logs to track the progress of the update.

Option B is not a recommended approach because it involves creating a new Auto Scaling group with the new launch configuration and registering it with the same load balancer. This approach can result in duplicate instances running concurrently, and it can be difficult to manage.

Option C is also not a recommended approach because it involves using two launch configurations in the same Auto Scaling group, which can make the configuration more complex and difficult to manage.

Option D is not a recommended approach because it involves creating a new load balancer, which can be time-consuming and may result in downtime during the transition period. Additionally, using Route53 weighted Round Robin can result in uneven distribution of traffic, which can impact the application's performance.