Question

Difficulty: MediumDeployment Strategy Design

A company is deploying a containerized microservice to Amazon ECS on AWS Fargate. The deployment pipeline is managed by AWS CodePipeline and AWS CodeDeploy using an Application Load Balancer. The company's deployment policy requires that exactly 15%15\% of production traffic be redirected to the new task set during the initial deployment phase. The new version must be evaluated for 20 minutes20\text{ minutes}, and if any Amazon CloudWatch alarms are triggered during this window, the deployment must automatically roll back. If no alarms are triggered, all traffic must be routed to the new version. Which strategy should the Solutions Architect implement to meet these requirements with the least operational overhead?

  1. Create a custom CodeDeploy deployment configuration using a TimeBasedCanary traffic routing configuration with a canary percentage of 15%15\% and a canary interval of 20 minutes20\text{ minutes}. Associate this configuration with the CodeDeploy deployment group.Answer
  2. B
    Configure the CodeDeploy deployment group to use the predefined CodeDeployDefault.ECSCanary15Percent20Minutes deployment configuration.
  3. C
    Configure Amazon Route 53 weighted routing records to direct 15%15\% of DNS queries to a new ECS service running the replacement task set. Use an AWS Lambda function triggered by an Amazon EventBridge scheduler rule to update the weights after 20 minutes20\text{ minutes}.
  4. D
    Configure the Application Load Balancer listener rule with weighted target groups, routing 15%15\% of traffic to the target group containing the new task set. Use an AWS Step Functions state machine to monitor CloudWatch alarms for 20 minutes20\text{ minutes} and update the target group weights.

Answer

Create a custom CodeDeploy deployment configuration using a TimeBasedCanary traffic routing configuration with a canary percentage of 15%15\% and a canary interval of 20 minutes20\text{ minutes}. Associate this configuration with the CodeDeploy deployment group.
The correct strategy is to create a custom CodeDeploy deployment configuration. AWS CodeDeploy natively supports ECS blue/green deployments where traffic is shifted between target groups. While AWS provides several predefined configurations (e.g., Canary10Percent5Minutes, Canary10Percent15Minutes), it also allows the creation of custom deployment configurations with arbitrary values for the canary percentage and interval. This matches the requirement of 15%15\% for 20 minutes20\text{ minutes} with minimal operational overhead.

Step-by-Step Solution

1
Determine if a predefined CodeDeploy deployment configuration matches the 15%15\% canary for 20 minutes20\text{ minutes} requirement.
Identify that only configurations like Canary10Percent5Minutes and Canary10Percent15Minutes exist as predefined options for ECS.
Verify if the requirement can be met with zero custom configuration.
2
Select the appropriate native AWS mechanism for custom ECS deployment routing.
Determine that creating a custom AWS::CodeDeploy::DeploymentConfig with a TimeBasedCanary configuration is supported and minimizes overhead.
Minimize administrative effort by avoiding custom orchestration logic like Step Functions or Lambda.
3
Evaluate and reject non-native or unreliable deployment methods.
Reject Route 53 weighted routing due to DNS caching limitations, and reject manual ALB target group shifting via Step Functions due to unnecessary operational complexity.
Ensure high reliability, fast rollbacks, and compliance with the 20-minute window constraint.

Key Concept

AWS CodeDeploy supports custom deployment configurations for Amazon ECS, allowing architects to define specific Canary or Linear traffic routing parameters when predefined defaults do not meet business requirements.
Rate this question