AWS Certified Solutions Architect Professional SAP-C02 Practice Question
A media streaming company runs a latency-sensitive microservice on Amazon ECS (EC2 launch type) behind a public Application Load Balancer (prod-ALB). Deployments currently use the ECS rolling-update strategy, but new container images sometimes start slowly and create HTTP 502 errors during deployment.
The operations team wants to adopt a blue/green deployment strategy to increase operational excellence. Requirements are:
Deployments must be triggered automatically from AWS CodePipeline.
Engineers must be able to run integration tests against the new revision before any production traffic is shifted.
If ALB health checks or the integration tests fail, traffic must revert to the previous version without manual intervention.
DNS changes must not introduce additional propagation latency or caching issues.
Which solution meets these requirements with the LEAST operational overhead?
Provision a second ALB for the green environment and configure a CloudFront distribution origin to the green ALB. After testing, update the origin group to send all traffic to the green ALB and invalidate the CloudFront cache.
Use AWS CodeDeploy with the Amazon ECS blue/green deployment type. Create a second target group for prod-ALB, let CodeDeploy manage two task sets of the same ECS service, and add a CodeDeploy action in CodePipeline to shift the ALB listener between the blue and green target groups with automatic rollback on failures.
Retain the rolling-update strategy but set minimumHealthyPercent to 100 and maximumPercent to 200 in the ECS service. Trigger deployments from CodePipeline and rely on ALB slow-start to reduce 502 errors.
Create a duplicate ECS service for the green environment and register its tasks in a new target group. Use Amazon Route 53 weighted records to shift traffic in 10 percent increments from blue to green, then set the blue weight to 0 if tests pass.
Using AWS CodeDeploy's blue/green deployment type for Amazon ECS satisfies every requirement.
CodeDeploy integrates with CodePipeline so a pipeline stage can initiate the deployment automatically.
When the deployment starts, CodeDeploy creates a second task set for the service and places it in an alternate target group that is attached to the same ALB listener. Engineers can hook automated tests to the AfterAllowTestTraffic lifecycle event to verify the new revision before it receives production traffic.
CodeDeploy monitors ALB health checks and optional CloudWatch alarms; if either fails, the service automatically rolls back by restoring the listener to the original target group.
Because the listener switch happens inside the ALB, no DNS records change, so there is no caching or TTL-related delay.
The other options do not meet one or more requirements:
Rolling updates with adjusted percentages provide no pre-traffic test phase and cannot guarantee automatic rollback without additional scripting.
Shifting traffic with Route 53 weighted records introduces DNS-TTL propagation delays and requires manual weight adjustments.
Maintaining two ALBs and updating a CloudFront origin adds complexity and still relies on cache invalidations rather than an instantaneous, listener-level traffic switch.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is AWS CodeDeploy's blue/green deployment type?
Open an interactive chat with Bash
What is an Application Load Balancer (ALB) listener?
Open an interactive chat with Bash
How does AWS CodePipeline integrate with CodeDeploy for ECS deployments?
Open an interactive chat with Bash
AWS Certified Solutions Architect Professional SAP-C02
Continuous Improvement for Existing Solutions
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access