Question

Difficulty: MediumDeployment Strategies and Execution

A SysOps Administrator manages a production web application deployed via an AWS CloudFormation template. The application runs on an Amazon EC2 Auto Scaling group (ASG) behind an Application Load Balancer, with a desired capacity of 44 instances. The administrator is preparing to update the template to roll out a new AMI using the AutoScalingRollingUpdate policy. The application must maintain its full capacity of 44 healthy instances throughout the update process to handle peak traffic. Which configuration for the AutoScalingRollingUpdate policy will satisfy this requirement?

  1. A
    Set MinInstancesInService to 22 and MaxBatchSize to 22.
  2. B
    Set MinInstancesInService to 00 and MaxBatchSize to 44.
  3. Set MinInstancesInService to 44 and MaxBatchSize to 22.Answer
  4. D
    Set SuspendProcesses to include Launch and Terminate processes.

Answer

Setting MinInstancesInService to 44 and MaxBatchSize to 22 ensures that AWS CloudFormation launches new instances first to maintain the desired capacity of 44 instances during the rolling update.
The correct configuration requires setting MinInstancesInService to 44 and MaxBatchSize to 22. This tells AWS CloudFormation that it must keep at least 44 instances running and healthy at all times. Since the group's desired capacity is 44, CloudFormation will satisfy this by first provisioning a batch of 22 new instances (bringing the total to 66) before terminating 22 old instances, keeping capacity at or above 44 throughout the rollout.

Step-by-Step Solution

1
Analyze the capacity requirement.
The application must maintain its desired capacity of 44 healthy instances throughout the update.
To prevent any reduction in capacity during the deployment.
2
Determine the role of MinInstancesInService.
Setting MinInstancesInService to 44 guarantees that at least 44 instances remain active.
If MinInstancesInService is less than 44, CloudFormation may terminate instances first, reducing active capacity below the required threshold.
3
Determine the role of MaxBatchSize.
Setting MaxBatchSize to 22 allows CloudFormation to update instances in batches of 22. Since 44 instances must remain in service, CloudFormation will launch 22 new instances first before terminating any old ones.
To transition the group to the new AMI incrementally while staying within the minimum capacity constraint.

Key Concept

AWS CloudFormation AutoScalingRollingUpdate UpdatePolicy configuration for maintaining application capacity

Alternative Method

Instead of an in-place rolling update on the same Auto Scaling group, the administrator could perform a blue/green deployment by creating a second Auto Scaling group using the new launch template, validating the new instances, and then updating the Application Load Balancer listener rule to point to the new target group. However, this would require managing additional resources outside the single Auto Scaling group scope.
Estimated Time:1m 30s
Rate this question