Question

Difficulty: Very hardDeployment Strategies

An application running on Amazon ECS (Fargate) is configured to use AWS CodeDeploy for blue/green deployments. The application resides behind an Application Load Balancer (ALB). The developer needs to configure the deployment pipeline to meet the following requirements:

* The deployment must begin by routing exactly 10%10\% of production traffic to the new task set (replacement task set), and then route the remaining 90%90\% of traffic after exactly 1010 minutes if the deployment remains stable.
* Before any production traffic is routed to the new task set, an automated test suite must run via an AWS Lambda function to validate the deployment's health.
* The deployment must automatically roll back if a specified Amazon CloudWatch alarm is triggered during the 1010-minute baking period.

Which TWO configurations must the developer implement to satisfy these requirements?

  1. Set the deployment configuration in the CodeDeploy deployment group to CodeDeployDefault.ECSCanary10Min10Percent.Answer
  2. In the AppSpec file, define the validation Lambda function under the BeforeAllowTraffic lifecycle hook.Answer
  3. C
    Set the deployment configuration in the CodeDeploy deployment group to CodeDeployDefault.ECSLinear10PercentEvery10Minutes.
  4. D
    In the AppSpec file, configure the validation Lambda function to run under the ValidateService lifecycle hook.
  5. E
    In the AppSpec file, configure the validation Lambda function to run under the AfterAllowTraffic lifecycle hook.

Answer

The developer must configure the deployment group to use the CodeDeployDefault.ECSCanary10Min10Percent strategy and define the validation Lambda function under the BeforeAllowTraffic hook in the AppSpec file.
The correct configurations specify using the CodeDeployDefault.ECSCanary10Min10Percent strategy to route the initial 10%10\% of traffic and wait 1010 minutes before routing the rest. Additionally, specifying the BeforeAllowTraffic hook in the AppSpec file ensures the validation Lambda function runs after the new task set is initialized but before production traffic is directed to it.

Step-by-Step Solution

1
Determine the traffic routing requirements.
Initial 10%10\% routing followed by the remaining 90%90\% after a 1010-minute baking period is a Canary pattern (specifically Canary 10% 10Min). Linear routing is ruled out.
Linear configurations shift traffic incrementally at each interval, whereas Canary configurations shift traffic in two distinct phases.
2
Identify the correct lifecycle hook for running validation tests.
The validation tests must run before any production traffic shifts. The BeforeAllowTraffic hook is the correct ECS deployment hook.
In ECS blue/green deployments, BeforeAllowTraffic executes after tasks are provisioned but before production traffic starts shifting. Other hooks like ValidateService are not supported on ECS, and AfterAllowTraffic runs too late.

Key Concept

ECS Blue/Green deployment traffic routing and lifecycle hook orchestration in AWS CodeDeploy
Rate this question