exam questions

Exam AWS DevOps Engineer Professional All Questions

View all questions & answers for the AWS DevOps Engineer Professional exam

Exam AWS DevOps Engineer Professional topic 1 question 51 discussion

Exam question from Amazon's AWS DevOps Engineer Professional
Question #: 51
Topic #: 1
[All AWS DevOps Engineer Professional Questions]

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?

  • A. At instance launch time, use EC2 user data to deploy the AWS CodeDeploy agent. Use CodeDeploy to install the Puppet agent. When the Auto Scaling group scales out, run a script to register the newly deployed instances to the Puppet master. When the Auto Scaling group scales in, use the EC2 Auto Scaling EC2_INSTANCE_TERMINATING lifecycle hook to trigger de-registration from the Puppet master.
  • B. Bake the AWS CodeDeploy agent into the base AMI. When the Auto Scaling group scales out, use CodeDeploy to install the Puppet agent, and execute a script to register the newly deployed instances to the Puppet master. When the Auto Scaling group scales in, use the CodeDeploy ApplicationStop lifecycle hook to run a script to de-register the instance from the Puppet master.
  • C. At instance launch time, use EC2 user data to deploy the AWS CodeDeploy agent. When the Auto Scaling group scales out, use CodeDeploy to install the Puppet agent, and run a script to register the newly deployed instances to the Puppet master. When the Auto Scaling group scales in, use the EC2 user data instance stop script to run a script to de-register the instance from the Puppet master.
  • D. Bake the AWS Systems Manager agent into the base AMI. When the Auto Scaling group scales out, use the AWS Systems Manager to install the Puppet agent, and run a script to register the newly deployed instances to the Puppet master. When the Auto Scaling group scales in, use the Systems Manager instance stop lifecycle hook to run a script to de-register the instance from the Puppet master.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
pleasespammelater
Highly Voted 3 years, 7 months ago
This is a tough one. The key to understanding it is that CodeDeploy and ASG's can work together! There's a great blog post about this: https://aws.amazon.com/blogs/devops/under-the-hood-aws-codedeploy-and-auto-scaling-integration/ Here is my analysis: A: This is the correct approach and matches the blog post writeup B: The CodeDeploy ApplicationStop lifecycle hook relates to upgrading an instance in place. The EC2 lifecycle hook is needed here. C: There is no such thing as a "user data instance stop script" D: SSM does not have lifecycle hooks
upvoted 53 times
...
amzngenius
Highly Voted 3 years, 8 months ago
D: https://aws.amazon.com/cn/blogs/mt/configure-amazon-ec2-instances-in-an-auto-scaling-group-using-state-manager/
upvoted 12 times
...
m4r0ck
Most Recent 1 year, 10 months ago
Selected Answer: A
A is the correct answer. ref. https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_LifecycleHookSpecification.html
upvoted 1 times
...
spikeme
2 years ago
Agree A
upvoted 1 times
...
Bulti
2 years, 4 months ago
Answer is A. D is incorrect as there is no such lifecycle hooks on System Manager. I am just not sure how we could install Puppet using CodeDeploy. Looks like to me it is similar to installing CloudWatch Agent with CodeDeploy using an S3 deployment.
upvoted 1 times
...
saeidp
2 years, 5 months ago
Yes, A is correct
upvoted 1 times
...
luk3k0
2 years, 5 months ago
Selected Answer: A
Agree A
upvoted 1 times
...
flavins
2 years, 6 months ago
Selected Answer: D
Why run codedeploy twice?
upvoted 2 times
...
Goozian
2 years, 8 months ago
Selected Answer: A
it's ASG, and all management is being done through ASG; Other services have no idea about ASG operation ( Scale in/out, ..) by default. The only reasonable response will be A
upvoted 2 times
...
vagobago
2 years, 9 months ago
Selected Answer: A
A seems to be the right solution. Highest voted D seems suspect - there is no such thing like "Systems Manager instance stop lifecycle hook"
upvoted 5 times
...
hubekpeter
2 years, 9 months ago
Selected Answer: D
The most easy and straight forward solution. https://aws.amazon.com/blogs/infrastructure-and-automation/run-code-before-terminating-an-ec2-auto-scaling-instance/
upvoted 6 times
...
WhyIronMan
3 years, 6 months ago
I'll go with A
upvoted 4 times
...
aws_Tamilan
3 years, 6 months ago
Correct Answer: A
upvoted 1 times
...
firbhat
3 years, 7 months ago
A as per below link: https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html
upvoted 1 times
...
svjl
3 years, 7 months ago
D: explained here https://aws.amazon.com/blogs/infrastructure-and-automation/run-code-before-terminating-an-ec2-auto-scaling-instance/
upvoted 3 times
...
jackdryan
3 years, 7 months ago
I'll go with A
upvoted 3 times
...
ChauPhan
3 years, 7 months ago
Thanks everybody with A. Seem there is no SSM Lifecycle Hook so D is incorrect
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...