Soru

Zorluk: Çok zorDeployment Strategy Design

An enterprise runs a session-dependent stateful web application on Amazon ECS using AWS Fargate, positioned behind an Application Load Balancer (ALB). The application does not use a distributed caching layer; instead, it relies on ALB cookie-based session stickiness to maintain user sessions on individual containers.

A Solutions Architect is designing a deployment strategy for a major application update. The deployment must satisfy the following constraints:
- The total compute capacity provisioned at any point during the deployment must not exceed 125%125\% of the standard desired task count due to strict organizational budget limits.
- Active users must not experience session disruption and must remain routed to the same application version they started on for the duration of their sessions.
- The Solutions Architect must be able to immediately roll back all traffic to the previous version if post-deployment smoke tests fail.

Which two actions should the Solutions Architect take to meet these requirements? (Select two.)

  1. Deploy the update by creating a second ECS service for the new version. Gradually adjust the weights of the two target groups on the ALB listener rule while scaling the desired task counts of the two ECS services in opposite directions, ensuring the total running task count never exceeds 125%125\% of the standard capacity.Cevap
  2. Configure target group-level stickiness on the ALB listener rule's weighted target groups. To execute an immediate rollback if failures are detected, set the weight of the new target group to 00 and disable target group-level stickiness on the listener rule.Cevap
  3. C
    Use AWS CodeDeploy to perform an ECS Blue/Green deployment using the default ECS linear traffic-shifting configuration, and configure the ECS service with a maximum percent of 125%125\%.
  4. D
    Configure a single ECS service with an ECS rolling update deployment type, setting the minimum healthy percent to 100%100\% and the maximum percent to 125%125\%, and rely on ALB target-level stickiness to maintain sessions during the rolling replacement of tasks.
  5. E
    Deploy the update using AWS CloudFormation with a blue/green deployment strategy, using AWS Route 53 weighted routing policy to shift traffic between two independent Application Load Balancers, each serving one version of the ECS service.

Cevap

Deploying the update using a second ECS service and adjusting target group weights and task counts manually to respect the 125%125\% capacity limit, and enabling target group-level stickiness on the ALB listener rule while disabling it along with setting the new target group's weight to 00 to execute an immediate rollback.
Deploying the update in a second ECS service allows the architect to manually scale the desired counts of the old and new services in opposite directions, keeping the total running task count below the 125%125\% limit. Enabling target group-level stickiness on the ALB weighted routing configuration ensures that active sessions remain pinned to their respective target groups (versions). To roll back immediately without waiting for sessions to naturally expire, the new target group weight must be set to 00 and target group-level stickiness must be disabled, which forces the ALB to ignore the client cookie and route all traffic to the old target group.

Adım Adım Çözüm

1
Analyze the capacity and rollback constraints.
CodeDeploy ECS Blue/Green cannot be used because it deploys the green task set at 100%100\% capacity, resulting in 200%200\% total capacity during deployment. A single ECS service rolling update cannot be used because rollback is not immediate.
To satisfy the resource constraints, a custom orchestration model using two separate ECS services must be implemented.
2
Orchestrate traffic shifting and capacity scaling.
Deploy the new version as a second ECS service and register it to a new ALB target group. Scale the services incrementally (e.g., 100%100\% old / 0%0\% new -> 75%75\% old / 25%25\% new -> 50%50\% old / 50%50\% new) to keep the total task count within 125%125\%.
This guarantees that the combined task count of both services never exceeds the maximum budget limits during the migration process.
3
Configure session stickiness on the ALB.
Enable target group-level stickiness on the ALB listener rule's weighted target groups.
Target group-level stickiness ensures that once a client is assigned to either the old or new target group based on weights, all subsequent requests are pinned to that target group for the duration of the session.
4
Define the rollback procedure.
Set the new target group weight to 00 and disable target group-level stickiness on the ALB listener rule.
Setting the weight to 00 stops new sessions from going to the new target group. Disabling target group-level stickiness is required because the ALB normally honors the stickiness cookie even if the weight is 00. Disabling it forces all clients (including those stuck to the new group) back to the old target group immediately.

Anahtar Kavram

ALB weighted target groups with target group-level stickiness and custom ECS blue/green deployment orchestration.
Bu soruyu puanla