Question

Difficulty: HardDeployment Strategy Design

A company is designing a deployment pipeline for a containerized microservice that will run on Amazon ECS with AWS Fargate behind an Application Load Balancer (ALB). The application requires zero downtime during updates. The deployment strategy must route exactly 10% of the production traffic to the new version of the microservice, maintain this traffic share for a soak period of exactly 10 minutes, and then shift all remaining traffic to the new version. If any Amazon CloudWatch alarms trigger during this 10-minute soak period, the deployment must automatically roll back immediately. Which strategy and configuration will meet these requirements with the least operational overhead?

  1. A
    Configure AWS CodeDeploy with a blue/green deployment. Select the predefined CodeDeployDefault.ECSCanary10Percent10Minutes deployment configuration, and associate the CloudWatch alarms with the deployment group to manage the rollback.
  2. Configure AWS CodeDeploy with a blue/green deployment. Create a custom CodeDeploy deployment configuration for ECS with a TimeBasedCanary routing type, specifying 10% traffic for a 10-minute interval. Associate the CloudWatch alarms with the deployment group to manage the rollback.Answer
  3. C
    Configure AWS CodeDeploy with a blue/green deployment. Select the predefined CodeDeployDefault.ECSLinear10PercentEvery1Minutes deployment configuration, and associate the CloudWatch alarms with the deployment group to manage the rollback.
  4. D
    Configure AWS CodeDeploy with an in-place deployment. Select the CodeDeployDefault.ECSAllAtOnce deployment configuration. Use an AWS Lambda function to update the Application Load Balancer target group routing weights to 10% for 10 minutes before shifting to 100%.

Answer

Configure AWS CodeDeploy with a blue/green deployment. Create a custom CodeDeploy deployment configuration for ECS with a TimeBasedCanary routing type, specifying 10% traffic for a 10-minute interval. Associate the CloudWatch alarms with the deployment group to manage the rollback.
The correct strategy uses a custom AWS CodeDeploy deployment configuration because AWS does not provide a predefined canary configuration for exactly 10 minutes (only 5-minute and 15-minute options are available). By defining a custom TimeBasedCanary routing configuration with a 10% canary percentage and a 10-minute interval, the system keeps traffic at 10% for the required soak duration before shifting the rest. Associating CloudWatch alarms with the CodeDeploy deployment group enables automatic, zero-downtime rollbacks if the alarms trigger.

Step-by-Step Solution

1
Determine the deployment type for ECS tasks under CodeDeploy.
Identify that CodeDeploy only supports blue/green deployments for ECS compute platforms.
ECS deployments require registering a replacement task set (green) and shifting traffic from the original task set (blue).
2
Identify the required traffic routing pattern and match against predefined AWS configurations.
Note that the business requires a canary pattern (10% traffic for 10 minutes). Recognize that there is no predefined CodeDeployDefault.ECSCanary10Percent10Minutes configuration (only 5-minute and 15-minute versions exist).
AWS provides a limited set of default configurations. Any non-standard duration requires defining a custom configuration.
3
Define a custom CodeDeploy deployment configuration.
Create a custom configuration with a TimeBasedCanary routing type, setting canaryPercentage to 10 and canaryInterval to 10.
This matches the exact business requirement of holding a 10% traffic share for a 10-minute soak period.
4
Configure the automated rollback mechanism.
Associate the CloudWatch alarms monitoring error rates with the CodeDeploy deployment group.
CodeDeploy natively monitors these alarms during the deployment and triggers an immediate traffic rollback to the original task set if any alarm enters the ALARM state.

Key Concept

Custom ECS deployment configurations and canary routing in AWS CodeDeploy
Rate this question