AWS Certified Solutions Architect – Associate (SAA-C02) — Question 92

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?

Answer options

Correct answer: B

Explanation

The correct answer is B because EC2 Auto Scaling lifecycle hooks allow you to run a custom script at specific points in the instance lifecycle, ensuring timely reporting both at launch and termination. Option A is less efficient as it relies on a scheduled function rather than immediate actions during instance events. Option C executes the script only at launch, missing out on termination reports, while option D lacks the automation provided by lifecycle hooks.