‹ All SAP-C02 questions

SAP-C02 Practice Question 87: ECS Blue Green Lifecycle Hooks

AWS Certified Solutions Architect – Professional (SAP-C02) · Test 9 · question 7 of 10

Continuous Improvementmedium

A web service runs on Amazon ECS behind an Application Load Balancer. Rolling deployments sometimes send errors to users before the team notices a bad release. The team wants to send test traffic to the new version and run automated smoke tests before production traffic is shifted, to keep the old version running for a period after the shift, and to be able to roll back quickly if problems appear. It accepts the temporary extra capacity that this needs.

Which solution meets these requirements?

Select one answer
Show answer and explanation

Answer:

  • C. Use an Amazon ECS blue/green deployment with lifecycle hooks that run the tests and a bake time after the traffic shift

With ECS blue/green deployments, *"you can validate new service revisions before directing production traffic to them"*. The benefits include testing with test traffic before switching production, *"automated validation through lifecycle hooks"* (Lambda hooks that run custom code at a lifecycle stage), and *"easy rollback"*: *"the blue revision is kept running until the bake time expires."* AWS notes the trade-off, *"blue/green deployments temporarily run both ... revisions simultaneously, which may double your resource usage"*, and the team accepts it (option C).

- A is wrong because a higher minimum healthy percent keeps more old tasks running during a rolling update, but the new tasks still receive production traffic as soon as they are healthy, with no test traffic, hooks or bake time. - B is wrong because stopping the old version causes downtime, which is the opposite of the goal, and it offers no validation or fast rollback. - D is wrong because a hand-managed second service and manual DNS weights recreate blue/green by hand, with slow DNS propagation and no automated tests, which makes rollback slower.

Reference: Amazon ECS blue/green deployments

Practice Test 9 ›

Study guides for SAP-C02