Q2 — AWS DOP-C02 Ch.1
Question 2 of 100 | ← Chapter 1
A DevOps engineer is using AWS CodeDeploy on a set of Amazon EC2 instances in an EC2 Auto Scaling group. The CodeDeploy deployment group associated with the EC2 Auto Scaling group is configured to use CodeDeployDefault.OneAtATime for in-place deployments. During an ongoing new deployment, the engineer observes that although the overall deployment succeeds, two-thirds of the instances deployed a previous application revision, while the remaining one-third have the latest application revision.
- A. The two affected instances were unable to retrieve 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 is not installed on the two affected instances.
- D. EC2 Auto Scaling launched two new instances during the new deployment before it completed, causing the previous application version to be deployed to the affected instances. ✓
Correct Answer: D. EC2 Auto Scaling launched two new instances during the new deployment before it completed, causing the previous application version to be deployed to the affected instances.
Explanation
When AWS CodeDeploy integrates with EC2 Auto Scaling and the deployment group is configured for OneAtATime execution, launching new instances during an active deployment can cause inconsistencies. If Auto Scaling triggers scaling events and launches new instances mid-deployment, those instances may launch using an outdated launch configuration or AMI referencing the prior application version. Since CodeDeploy’s current deployment targets only pre-existing instances, newly launched instances fall outside the scope of that deployment and inherit the older version. This matches option D and aligns with CodeDeploy’s deployment model and Auto Scaling’s dynamic scaling behavior. Other options either contradict the reported success status or fail to explain why only some instances were unaffected.