AWS DevOps Engineer Professional Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Enhance your AWS skills with our AWS DevOps Engineer Professional Test. Ace your certification with multiple choice questions, detailed explanations, and comprehensive study guides. Prepare effectively and conquer the exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


How can you log events for instances launching or terminating in an Auto Scaling Group?

  1. Create a CloudFormation stack to store logs

  2. Create a Lambda function triggered by CloudWatch Events

  3. Enable logging within the Auto Scaling Group settings

  4. Utilize AWS CloudTrail for logging

The correct answer is: Create a Lambda function triggered by CloudWatch Events

Creating a Lambda function that is triggered by CloudWatch Events is a highly effective method for logging events related to instances launching or terminating in an Auto Scaling Group. When you create an Auto Scaling Group, AWS automatically generates CloudWatch Events for significant actions, such as instance launch and termination. By configuring a Lambda function to listen for these events, you can process and log the information as needed in real-time. This approach allows for greater flexibility and efficiency, as the Lambda function can be designed to log specific attributes of the instance events and integrate with other logging systems, such as writing to Amazon S3, DynamoDB, or sending notifications through AWS SNS. Additionally, it can handle a variety of actions beyond simple logging, such as triggering alerts or performing additional processing as required. In contrast, while AWS CloudTrail does enable logging of API calls, it is more focused on auditing specific API actions rather than real-time event logging as enabled through CloudWatch Events and Lambda. The other options, like creating a CloudFormation stack or utilizing logging settings within the Auto Scaling Group, would not directly provide the event-driven approach required for immediate logging of lifecycle events. Thus, using a Lambda function triggered by CloudWatch Events effectively captures and logs the necessary data in a dynamic and