A team runs a containerised service on Amazon ECS and deploys it with AWS CodeDeploy. They want each release to stand up the new task set behind a separate test listener, run automated validation against it before any production traffic arrives, and only then shift the production listener over. Which deployment approach supports running validation on the new tasks before they receive production traffic?
- AUse the ECS rolling update deployment controller and add a BeforeAllowTraffic lifecycle hook to the task definition so tests run against each task as it replaces an old one.
- BUse the CodeDeploy in-place deployment controller for ECS and configure an AfterAllowTraffic hook so validation runs on the new task set right after the test listener is created.
- CUse the external deployment controller and write a custom script that registers a test listener, then promote the new tasks once the script reports the validation checks have passed.
- DUse the CodeDeploy blue/green deployment controller with a test listener and a BeforeAllowTraffic hook Lambda in the AppSpec that validates the new task set before production traffic is shifted. Correct
Why A is wrong: The ECS rolling controller has no CodeDeploy lifecycle hooks and replaces tasks in place behind the live listener, so there is no separate test listener to validate the new tasks before production traffic.
Why B is wrong: ECS deployments through CodeDeploy use the blue/green model rather than in-place, and AfterAllowTraffic runs once traffic already flows, so validation would happen too late to gate production traffic.
Why C is wrong: The external controller hands all orchestration to your own code with no built-in lifecycle hooks or test listener wiring, so it does far more custom work than the managed blue/green flow the team needs.
Why D is correct: Blue/green on ECS provisions a replacement task set behind a test listener, and the BeforeAllowTraffic hook runs a validation Lambda against it before the production listener is rerouted, matching every requirement.