Soru

Zorluk: Çok zorDeployment Strategy Design

An enterprise runs a critical application on Amazon EC2 instances managed by an Auto Scaling group (ASG) behind an Application Load Balancer (ALB). The application must maintain at least 90% of its normal capacity (10 instances) at all times during updates. The solutions architect must design a deployment strategy that routes 10% of incoming traffic to a new version of the application for a 20-minute evaluation period, with the remaining 90% routed to the current version. If HTTP 5xx errors exceed a specified threshold during this period, the deployment must automatically roll back. Due to strict vCPU service quotas in the AWS Region, the organization cannot provision a duplicate ASG of the same size to perform a standard CodeDeploy blue/green deployment. Which two actions should the solutions architect recommend to meet these requirements?

  1. Configure the Application Load Balancer with two target groups: a primary target group pointing to the existing production Auto Scaling group, and a canary target group pointing to a new, separate Auto Scaling group provisioned with 10% of the production group's capacity.Cevap
  2. Configure the Application Load Balancer listener rule to use weighted target group routing, directing 90% of traffic to the primary target group and 10% to the canary target group, and use an AWS Lambda function triggered by CloudWatch alarms to reset the canary target group weight to 0% upon failure.Cevap
  3. C
    Configure AWS CodeDeploy with a Blue/Green deployment type, selecting the existing Auto Scaling group and using the CodeDeployDefault.EC2Canary10Percent20Minutes deployment configuration to manage the traffic shifting.
  4. D
    Apply a CloudFormation UpdatePolicy with an AutoScalingRollingUpdate to the Auto Scaling group, setting MaxBatchSize to 10% and MinInstancesInService to 90%, and configure the ALB to route 10% of traffic to the updating instances.
  5. E
    Configure AWS CodeDeploy with an In-Place deployment type using the CodeDeployDefault.OneAtATime configuration, and enable ALB traffic shifting in the deployment group to isolate 10% of traffic to the newly deployed instances.

Cevap

The solutions architect should configure the Application Load Balancer with two target groups (one for the primary ASG and one for the 10% canary ASG) and configure the ALB listener rule with weighted target group routing combined with an AWS Lambda function triggered by CloudWatch alarms to reset the weight to 0% on failure.
To achieve a 10% canary deployment on EC2 without duplicating the entire ASG (which would violate vCPU service quotas), the Solutions Architect must design a custom deployment strategy. This is done by creating a separate target group and a smaller Auto Scaling group sized to 10% of the primary ASG (1 instance). An ALB listener rule with weighted target groups is used to shift 10% of the traffic to the canary group. If a failure occurs, a Lambda function triggered by CloudWatch alarms can automatically reset the weight to 0%, executing a rollback without affecting the primary production fleet.

Adım Adım Çözüm

1
Analyze deployment constraints
Determine that native CodeDeploy blue/green deployments cannot be used because they copy the entire Auto Scaling group, which violates the regional vCPU quota constraint. Also, realize that CodeDeploy canary/linear traffic shifting is not supported on EC2.
This rules out native CodeDeploy options and establishes the need for a custom deployment strategy.
2
Design the target groups and Auto Scaling groups
Define a primary target group for the existing 10-instance ASG, and provision a separate, smaller ASG (with 1 instance, representing 10% capacity) mapped to a canary target group.
This satisfies the requirement to maintain 90% capacity during deployments without exceeding the region's vCPU quota.
3
Configure load balancer routing
Configure the ALB listener rule with weighted target group routing, mapping 90% weight to the primary target group and 10% weight to the canary target group.
This implements the 10% canary traffic split required for evaluation.
4
Implement automated rollback monitoring
Set up a CloudWatch alarm for HTTP 5xx errors and configure it to trigger an AWS Lambda function that resets the canary target group weight to 0% and scales down the canary ASG if error thresholds are exceeded.
This guarantees a fast, automated rollback within the required time window.

Anahtar Kavram

Custom canary deployment design on AWS EC2 when native CodeDeploy deployment options are limited by region quotas or platform capabilities.
Bu soruyu puanla