exam questions

Exam AWS Certified Solutions Architect - Associate SAA-C02 All Questions

View all questions & answers for the AWS Certified Solutions Architect - Associate SAA-C02 exam

Exam AWS Certified Solutions Architect - Associate SAA-C02 topic 1 question 87 discussion

A company recently deployed a new auditing system to centralize information about operating system versions, patching, and installed software for Amazon EC2 instances. A solutions architect must ensure all instances provisioned through EC2 Auto Scaling groups successfully send reports to the auditing system as soon as they are launched and terminated.
Which solution achieves these goals MOST efficiently?

  • A. Use a scheduled AWS Lambda function and run a script remotely on all EC2 instances to send data to the audit system.
  • B. Use EC2 Auto Scaling lifecycle hooks to run a custom script to send data to the audit system when instances are launched and terminated.
  • C. Use an EC2 Auto Scaling launch configuration to run a custom script through user data to send data to the audit system when instances are launched and terminated.
  • D. Run a custom script on the instance operating system to send data to the audit system. Configure the script to be executed by the EC2 Auto Scaling group when the instance starts and is terminated.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
josebormo
Highly Voted 3 years, 9 months ago
I agree B -> https://docs.aws.amazon.com/es_es/autoscaling/ec2/userguide/lifecycle-hooks.html
upvoted 35 times
plaster
3 years, 9 months ago
You can add a lifecycle hook to your Auto Scaling group so that you can perform custom actions when instances launch or terminate
upvoted 23 times
...
Umapada
2 years, 8 months ago
https://docs.aws.amazon.com/en_us/autoscaling/ec2/userguide/lifecycle-hooks.html
upvoted 1 times
...
pvm14
3 years, 8 months ago
You added the link to the spanish page. That is my mother tongue but I guess nobody is interested here in links is Spanish :)
upvoted 7 times
CarlosSainz55
3 years, 8 months ago
Yo si ;)
upvoted 5 times
...
genni
3 years, 8 months ago
Here it's English Version. https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html
upvoted 3 times
...
...
...
Paitan
Highly Voted 3 years, 9 months ago
Agree with B. Lifecycle hooks seem to be a good fit.
upvoted 19 times
aguy9
3 years, 9 months ago
I agree, the answer is definitely B
upvoted 3 times
...
...
L_E_O
Most Recent 2 years, 7 months ago
Selected Answer: B
B is correct
upvoted 1 times
...
SmartDude
3 years, 5 months ago
Selected Answer: B
https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html
upvoted 2 times
...
EmeraldTech
3 years, 6 months ago
I agree with the answer is B. Read this - Amazon EC2 Auto Scaling offers the ability to add lifecycle hooks to your Auto Scaling groups. These hooks enable an Auto Scaling group to be aware of events in the Auto Scaling instance lifecycle, and then perform a custom action when the corresponding lifecycle event occurs. A lifecycle hook provides a specified amount of time (one hour by default) to complete the lifecycle action before the instance transitions to the next state. https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html
upvoted 3 times
...
dhakad05
3 years, 8 months ago
Ans is B The lifecycle hook puts the instance into a wait state (Pending:Wait) and then performs a custom action.
upvoted 2 times
...
Pavan111
3 years, 8 months ago
Answer is B: Analysis: A. Use a scheduled AWS Lambda function and execute a script remotely on all EC2 instances to send data to the audit system ( Note: You can't use Lambda as Configuration management tool ) C. Use an EC2 Auto Scaling launch configuration to execute a custom script through user data to send data to the audit system when instances are launched and terminated. ( With userdate we can execute commands on ec2 only on the creation time, we can't execute commands on instance using userdata while the instance is getting terminated ) D. D. Execute a custom script on the instance operating system to send data to the audit system. Configure the script to be executed by the EC2 Auto Scaling group when the instance starts and is terminated. ( You can't tell ASG to execute script on ec2 ).
upvoted 8 times
...
Abdullah777
3 years, 8 months ago
For example, let's say that your newly launched instance completes its startup sequence and a lifecycle hook pauses the instance. While the instance is in a wait state, you can install or configure software on it, making sure that your instance is fully ready before it starts receiving traffic. For another example of the use of lifecycle hooks, let's say that when a scale-in event occurs, the terminating instance is first deregistered from the load balancer (if the Auto Scaling group is being used with Elastic Load Balancing). Then, a lifecycle hook pauses the instance before it is terminated. While the instance is in the wait state, you can, for example, connect to the instance and download logs or other data before the instance is fully terminated. https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html
upvoted 4 times
...
syu31svc
3 years, 8 months ago
https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html: "For example, let's say that your newly launched instance completes its startup sequence and a lifecycle hook pauses the instance. While the instance is in a wait state, you can install or configure software on it, making sure that your instance is fully ready before it starts receiving traffic" Answer is B
upvoted 2 times
...
KK_uniq
3 years, 8 months ago
Life cycle hooks are the way to go B for sure
upvoted 1 times
...
mryala
3 years, 8 months ago
it's B
upvoted 1 times
...
Ankitrathi85
3 years, 8 months ago
B right
upvoted 1 times
...
AEN
3 years, 8 months ago
Ans is B
upvoted 1 times
...
Elias23
3 years, 9 months ago
bbbbbbbb
upvoted 1 times
...
Mathuria
3 years, 9 months ago
Agree with B. Lifecycle hooks
upvoted 1 times
...
youngoose
3 years, 9 months ago
answer B Lifecycle hooks allow you to control what happens when your Amazon EC2 instances are launched and terminated as you scale out and in. For example, you might download and install software when an instance is launching, and archive instance log files in Amazon Simple Storage Service (S3) when an instance is terminating.
upvoted 2 times
...
anpt
3 years, 9 months ago
BBBBBBBBBBBBBBBBBBB
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 ...