Free AWS DOP-C02 Actual Exam Questions - Question 11 Discussion

Question No. 11
A company is using AWS CodeDeploy to automate software deployment. The deployment must meet
these requirements:
• A number of instances must be available to serve traffic during the deployment Traffic must be
balanced across those instances, and the instances must automatically heal in the event of failure.
• A new fleet of instances must be launched for deploying a new revision automatically, with no
manual provisioning.
• Traffic must be rerouted to the new environment to half of the new instances at a time. The
deployment should succeed if traffic is rerouted to at least half of the instances; otherwise, it should
fail.
• Before routing traffic to the new fleet of instances, the temporary files generated during the
deployment process must be deleted.
• At the end of a successful deployment, the original instances in the deployment group must be
deleted immediately to reduce costs.
How can a DevOps engineer meet these requirements?
Select all that apply, then reveal solution.
US
MB
Mason B.
2026-02-21

B vs C? Both use blue/green which fits the new fleet and traffic shifting needs. B sets a custom min healthy hosts at 50% which matches the “half the instances” requirement, but the BeforeBlockTraffic hook might run too early since traffic is still flowing. C uses CodeDeployDefault.HalfAtAtime which is designed for shifting traffic half at a time and has the BeforeAllowTraffic hook to delete temp files just before traffic switches, which seems cleaner. C also mentions immediate termination of old instances. I’d pick C over B mainly because of better timing on deleting temp files and deployment

0
HU
Haris U.
2026-02-04

D imo doesn’t work because in-place deployments can’t launch a new fleet automatically, which is a key requirement here. Also, CodeDeployDefault.AllAtOnce would shift all traffic at once, not half at a time. That conflicts with the staged traffic rerouting. So the option’s deployment type and strategy seem off for the requirements. The hooks timing for deleting temp files also feels less precise compared to BeforeAllowTraffic for cleaning right before traffic hits new instances. Overall, D misses the automatic fleet launch and controlled traffic shift parts, which are pretty critical here.

0
HU
Haris U.
2026-02-03

Maybe C fits best since it uses blue/green deployment and HalfAtAtime config, matching the gradual traffic shift. Plus, BeforeAllowTraffic hook sounds right to clean temp files before routing traffic.

0
HU
Haris U.
2026-02-03

Not sure about B’s BeforeBlockTraffic hook—doesn’t the question say temp files must be deleted before routing traffic? That seems more like BeforeAllowTraffic timing, which C uses. Could that make C more aligned with the sequence needed?

0
HU
Haris U.
2026-02-03

C imo nails the half-at-a-time traffic shift with CodeDeployDefault.HalfAtAtime, which fits the requirement better than B’s 50% minimum healthy hosts. The BeforeAllowTraffic hook also seems like the right timing to clean temp files just before routing.

0
ZJ
Zain J.
2026-02-01

It’s B because it uses blue/green with auto-scaling copy and sets 50% minimum healthy hosts, matching the traffic reroute needs. Also, BeforeBlockTraffic is the right hook to clear temp files before shifting traffic.

0
OP
Osama P.
2026-01-27

C imo fits better because it uses the blue/green deployment with CodeDeployDefault.HalfAtAtime, which directly matches the requirement to reroute traffic to half the new instances at a time and succeed if at least half are healthy. Also, BeforeAllowTraffic is exactly the right hook to delete temp files before traffic shifts, not BeforeBlockTraffic like in B. That hook timing seems more precise for the cleanup step. Plus, it has automatic scaling group copying and terminates original instances immediately, ticking all boxes without any mismatch in deployment config or hook usage.

0
MV
Mason V.
2026-01-16

Maybe B, but does the question specify which appspec.yml lifecycle hook to use exactly?

0