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 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.)
- 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 of the standard capacity.Answer
- 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 and disable target group-level stickiness on the listener rule.Answer
- CUse 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 .
- DConfigure a single ECS service with an ECS rolling update deployment type, setting the minimum healthy percent to and the maximum percent to , and rely on ALB target-level stickiness to maintain sessions during the rolling replacement of tasks.
- EDeploy 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.