Question

Difficulty: MediumDeployment Strategy Design

A Solutions Architect is designing the deployment strategy for a new web application hosted on Amazon ECS with AWS Fargate. The application is fronted by an Application Load Balancer (ALB). The deployment process must satisfy the following business requirements:

- Shift 10% of the traffic to the new version initially, and shift the remaining 90% after 10 minutes of successful monitoring.
- Automatically roll back the deployment immediately if the HTTP 5xx error rate on the ALB exceeds 1% during the evaluation period.
- Rollbacks must incur zero downtime and ensure that no lingering traffic is directed to the new version.

Which two configurations should the Solutions Architect specify to meet these requirements?

  1. Configure AWS CodeDeploy with a deployment group that specifies the CodeDeployDefault.ECSCanary10Percent10Minutes deployment configuration.Answer
  2. Create an Amazon CloudWatch alarm for the Application Load Balancer HTTPCode_Target_5XX_Count metric, and add this alarm to the rollback configuration of the CodeDeploy deployment group.Answer
  3. C
    Configure the Amazon ECS service to use the rolling update deployment controller and set the DeploymentCircuitBreaker to roll back the stack on failure.
  4. D
    Set up Amazon Route 53 weighted routing policies targeting two separate ECS services, and run an AWS Lambda function to update the routing weights and handle rollbacks.
  5. E
    Configure a linear traffic shifting policy in AWS App Mesh using Virtual Router routes, and configure a custom AWS Lambda function to update the weights and rollback if 5xx errors occur.

Answer

The correct configurations are to configure AWS CodeDeploy with a deployment group that specifies the CodeDeployDefault.ECSCanary10Percent10Minutes deployment configuration, and to create an Amazon CloudWatch alarm for the Application Load Balancer HTTPCode_Target_5XX_Count metric, adding this alarm to the rollback configuration of the CodeDeploy deployment group.
The correct answer combines AWS CodeDeploy's native canary deployment capability for Amazon ECS with Application Load Balancer monitoring. AWS CodeDeploy provides the built-in CodeDeployDefault.ECSCanary10Percent10Minutes deployment configuration, which shifts 10% of the traffic to the replacement task set (the new version), waits 10 minutes, and then shifts the remaining 90%. To automate the rollback based on HTTP 5xx errors, a CloudWatch alarm must be configured for the Application Load Balancer's HTTPCode_Target_5XX_Count metric and defined as a rollback trigger in the CodeDeploy deployment group. If the alarm transitions to the ALARM state during the deployment, CodeDeploy immediately and automatically reroutes 100% of the traffic back to the original task set, achieving zero downtime.

Step-by-Step Solution

1
Set the deployment controller for the Amazon ECS service to AWS CodeDeploy.
Enables blue/green deployments and canary routing configurations on the target ECS service.
Allows AWS CodeDeploy to manage the creation of a replacement task set and control traffic routing using target groups.
2
Specify the CodeDeployDefault.ECSCanary10Percent10Minutes deployment configuration in the CodeDeploy deployment group.
Configures a traffic shifting pattern where 10% of traffic is routed to the new task set, followed by the remaining 90% after 10 minutes.
Directly satisfies the business requirement for a 10% canary traffic shift and a 10-minute evaluation period.
3
Create an Amazon CloudWatch alarm monitoring the HTTPCode_Target_5XX_Count metric on the Application Load Balancer.
Generates an alarm state if the rate of HTTP 5xx errors exceeds the specified threshold.
Establishes a quantitative monitoring mechanism for the application's error rate.
4
Associate the CloudWatch alarm as a rollback trigger within the AWS CodeDeploy deployment group.
Triggers an automatic rollback of the deployment if the alarm goes into the ALARM state during the canary phase.
Ensures immediate rollback to the original task set with zero downtime and no lingering traffic to the replacement tasks.

Key Concept

Deployment Strategy Design using AWS CodeDeploy for Amazon ECS
Rate this question