Question

Difficulty: HardDeployment Strategy Design

A company is deploying a new version of a critical web application that runs on Amazon ECS with the AWS Fargate launch type. The application is behind an Application Load Balancer (ALB). The application handles multi-step transactions and maintains state using session affinity (sticky sessions) stored in the local memory of the containers. The transaction workflow can take up to 20 minutes to complete. The deployment strategy for the new version must meet the following requirements:

* Shift traffic gradually to the new version to minimize the blast radius of potential issues.
* Ensure that users with active sessions are not routed to the new version mid-transaction, which would break their session state.
* Automatically roll back the deployment if the HTTP 5XX error rate or the target response time of the new version exceeds defined thresholds.

Which combination of actions will meet these requirements? (Select TWO.)

  1. Configure AWS CodeDeploy with a canary deployment configuration (such as CodeDeployDefault.ECSCanary10Percent5Minutes) to route traffic to the green target group, and specify CloudWatch alarms based on the ALB HTTPCode_Target_5XX_Count and TargetResponseTime metrics as rollback triggers in the deployment group.Answer
  2. Enable target group stickiness on the ALB listener rule that routes traffic to the blue and green target groups, and set the stickiness duration to 25 minutes.Answer
  3. C
    Configure the ECS service deployment controller to use ECS rolling updates (ECS), set the minimum healthy percent to 100%, enable ECS deployment circuit breakers with rollback, and use target group stickiness on the ALB.
  4. D
    Configure AWS CodeDeploy with the CodeDeployDefault.ECSAllAtOnce deployment configuration, enable target-level stickiness on both the blue and green target groups, and configure a CloudWatch alarm on the ALB ActiveConnectionCount metric to trigger rollback.
  5. E
    Create a secondary Application Load Balancer for the new ECS service version, configure Amazon Route 53 with weighted routing to split traffic between the two load balancers, and enable Route 53 target health evaluation for automated rollback.

Answer

Configure AWS CodeDeploy with a canary deployment configuration and specify CloudWatch alarms for HTTP 5XX count and target response times as rollback triggers, and enable target group stickiness on the ALB listener rule with a duration of 25 minutes.
The correct solution involves combining AWS CodeDeploy canary deployments with ALB target group stickiness. Configuring CodeDeploy with a canary deployment configuration and specifying CloudWatch alarms for target 5XX counts and response times ensures gradual traffic shifting and automated rollbacks based on application performance. Enabling target group stickiness on the ALB listener rule ensures that users with active sessions are not shifted between the blue and green target groups mid-transaction, preserving local container-based session state.

Step-by-Step Solution

1
Set up weighted routing and session persistence at the load balancer layer.
By enabling target group stickiness on the ALB listener rule, the load balancer generates a cookie that binds client sessions to either the blue or green target group.
This ensures that once a client session begins on a specific target group (and thus is directed to a specific container version), the user remains bound to that target group for the duration of the multi-step transaction (25 minutes), preventing session state loss even as routing weights change.
2
Configure the deployment controller and traffic shifting behavior.
AWS CodeDeploy uses an ECS deployment group with a canary traffic-shifting configuration (e.g., CodeDeployDefault.ECSCanary10Percent5Minutes) to gradually shift traffic from the blue target group to the green target group.
This satisfies the requirement to shift traffic gradually, minimizing the blast radius by only routing a small percentage of new sessions to the new version initially.
3
Configure automated rollback triggers based on application health.
Associate CloudWatch alarms monitoring ALB metrics (HTTPCode_Target_5XX_Count and TargetResponseTime) on the new target group with the CodeDeploy deployment group.
This allows CodeDeploy to automatically detect increased latency or error rates on the new version and trigger an immediate rollback to the original version without human intervention.

Key Concept

AWS CodeDeploy Blue/Green deployment for Amazon ECS with Application Load Balancer target group stickiness.
Rate this question