AWS Certified Cloud Practitioner (CLF-C02) — Question 462

A user wants to invoke an AWS Lambda function when an Amazon EC2 instance enters the “stopping” state.

Which AWS service is appropriate for this use case?

Answer options

Correct answer: A

Explanation

Amazon EventBridge can monitor real-time state changes of AWS resources, such as an EC2 instance entering a "stopping" state, and route these events to targets like AWS Lambda. AWS Config tracks configuration history and compliance rather than handling real-time event routing, while Amazon SNS is a notification service that cannot directly detect EC2 state changes on its own. AWS CloudFormation is used for infrastructure provisioning and is not designed for event-driven automation.