AWS Certified Solutions Architect Professional SAP-C02 Practice Question
Your company runs a mission-critical microservices application on Amazon ECS using the Fargate launch type. The service sits behind an Application Load Balancer with a single production listener. The current CI/CD pipeline builds a new container image, pushes it to Amazon ECR, and then updates the ECS service with a rolling deployment that uses minimumHealthyPercent = 50 and maximumPercent = 100. During recent releases, customers intermittently received HTTP 502 errors while tasks were being replaced. Leadership now mandates that future deployments must satisfy these requirements:
- Zero downtime for end users
- Automated integration tests must run on the new task set before production traffic is routed
- Any failed test or CloudWatch alarm must trigger an automatic rollback with no operator intervention
Which solution will BEST meet these operational-excellence goals while requiring the least manual effort?
Create a separate ECS service in a second target group and use Amazon Route 53 weighted records to gradually shift traffic; invoke a Lambda function to reduce the weight if CloudWatch alarms are triggered.
Retain the rolling deployment but change minimumHealthyPercent to 100 and maximumPercent to 200, and enable the ECS deployment circuit breaker with automatic rollback.
Refactor the pipeline to use AWS CodeDeploy blue/green deployments for the ECS service. Add a test listener to the ALB that routes validation traffic to the green task set, configure lifecycle hooks to run integration tests, and enable automatic rollback on associated CloudWatch alarms.
Switch the deployment controller to CODE_DEPLOY and use the CodeDeployDefault.ECSAllAtOnce deployment configuration without a test listener; add a manual approval action in the pipeline before traffic is shifted.