AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 142
A DevOps engineer is using AWS CodeDeploy across a fleet of Amazon EC2 instances in an EC2 Auto Scaling group. The associated CodeDeploy deployment group, which is integrated with EC2 Auto Scaling, is configured to perform in-place deployments with CodeDeployDefault.OneAtATime. During an ongoing new deployment, the engineer discovers that, although the overall deployment finished successfully, two out of five instances have the previous application revision deployed. The other three instances have the newest application revision.
What is likely causing this issue?
Answer options
- A. The two affected instances failed to fetch the new deployment.
- B. A failed AfterInstall lifecycle event hook caused the CodeDeploy agent to roll back to the previous version on the affected instances.
- C. The CodeDeploy agent was not installed in two affected instances.
- D. EC2 Auto Scaling launched two new instances while the new deployment had not yet finished, causing the previous version to be deployed on the affected instances.
Correct answer: D
Explanation
The correct answer is D because EC2 Auto Scaling can create new instances during a deployment, and if these instances are initialized before the new version is deployed, they will receive the previous application version. The other options do not address the situation accurately, as they either imply issues with fetching the deployment or problems with the CodeDeploy agent, which are not indicated by the scenario described.