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
- A. Amazon EventBridge
- B. AWS Config
- C. Amazon Simple Notification Service (Amazon SNS)
- D. AWS CloudFormation
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.