AWS Certified DevOps Engineer – Professional — Question 8

An online company uses Amazon EC2 Auto Scaling extensively to provide an excellent customer experience while minimizing the number of running EC2 instances. The company's self-hosted Puppet environment in the application layer manages the configuration of the instances. The IT manager wants the lowest licensing costs and wants to ensure that whenever the EC2 Auto Scaling group scales down, removed EC2 instances are deregistered from the Puppet master as soon as possible.
How can the requirement be met?

Answer options

Correct answer: A

Explanation

Option A is correct because it utilizes the EC2_INSTANCE_TERMINATING lifecycle hook, which ensures that deregistration from the Puppet master occurs immediately when instances are terminated. Option B is incorrect as it relies on the CodeDeploy ApplicationStop lifecycle hook, which is not as timely for deregistration. Option C uses EC2 user data for scaling in, which may not trigger deregistration promptly. Option D incorrectly suggests using the AWS Systems Manager agent, which is not the specified requirement for managing the Puppet environment.