Question

Difficulty: HardDeployment Strategy Design

A company is designing a deployment strategy for a stateful ingestion service running on Amazon EC2 instances within an Auto Scaling group (ASG) behind an Application Load Balancer (ALB). The service maintains long-lived WebSockets connections with millions of IoT devices. The deployment of application updates must satisfy three requirements: first, existing WebSockets connections must not be prematurely terminated and must drain naturally for up to 15 minutes; second, the maximum temporary capacity increase must not exceed 25% of the current fleet size due to strict IP address space constraints in the VPC subnets; and third, the deployment must automatically roll back if the system error rate exceeds 2% during a 30-minute validation period post-deployment. Which deployment configuration will meet these requirements?

  1. Configure the Application Load Balancer target group deregistration delay to 900 seconds. Perform an Auto Scaling group Instance Refresh with the minimum healthy percentage set to 100%, and configure the instance refresh rollback preferences to monitor a CloudWatch alarm that tracks the system error rate, triggering an automatic rollback if the error rate exceeds 2%.Answer
  2. B
    Use AWS CodeDeploy to perform a Blue/Green deployment. Set the target group deregistration delay to 900 seconds, create a new target group and Auto Scaling group, and configure a CodeDeploy deployment configuration to route traffic while monitoring a CloudWatch alarm for system error rates.
  3. C
    Configure the Application Load Balancer target group deregistration delay to 900 seconds. Use AWS CloudFormation to update the stack with an AutoScalingRollingUpdate policy, setting MinInstancesInService to 100% and configuring CloudFormation rollback triggers based on the system error rate CloudWatch alarm.
  4. D
    Configure the Application Load Balancer target group deregistration delay to 180 seconds. Perform an Auto Scaling group Instance Refresh with the minimum healthy percentage set to 75%, and configure a custom AWS Lambda function to monitor the system error rate and call the CancelInstanceRefresh API if the error rate exceeds 2%.

Answer

Configure the Application Load Balancer target group deregistration delay to 900 seconds, perform an Auto Scaling group Instance Refresh with the minimum healthy percentage set to 100%, and configure the instance refresh rollback preferences to monitor a CloudWatch alarm tracking the system error rate.
The correct configuration utilizes the Application Load Balancer target group deregistration delay to allow existing WebSockets connections to drain naturally for up to 15 minutes (900 seconds). By using an Auto Scaling group Instance Refresh with a minimum healthy percentage of 100%, the ASG is forced to roll out the update in batches, launching new instances before terminating the old ones. This restricts the maximum capacity increase to the batch size (25% or less), staying within the VPC subnet IP address limits. The native instance refresh rollback preferences then monitor the system error rate CloudWatch alarm, automatically rolling back the deployment if the 2% threshold is exceeded during the deployment and warm-up validation window.

Step-by-Step Solution

1
Configure the ALB target group attribute for deregistration delay.
The deregistration delay is set to 900 seconds (15 minutes), ensuring existing WebSockets connections are allowed to drain naturally without receiving new traffic.
This directly satisfies the requirement for zero downtime and a 15-minute natural drain time for active connections.
2
Initiate an Auto Scaling group Instance Refresh with the minimum healthy percentage parameter.
Setting the minimum healthy percentage to 100% forces the ASG to launch new instances before terminating old ones. The maximum capacity increase is determined by the batch size (e.g., 25%), which keeps the temporary capacity increase within the subnet IP limits.
This satisfies the capacity constraint that limits the temporary instance increase to at most 25% while maintaining service availability.
3
Configure Auto Rollback preferences within the Instance Refresh configuration, specifying the system error rate CloudWatch alarm.
If the error rate alarm triggers during the deployment or the instance warmup validation period, the ASG automatically terminates the refresh and rolls back to the previous launch template.
This satisfies the requirement for an automated rollback based on a post-deployment validation period.

Key Concept

Auto Scaling group Instance Refresh supports rolling updates with native rollback capabilities based on CloudWatch alarms, while ALB target group deregistration delay manages connection draining for stateful connections.
Rate this question