A retailer puts EC2 state-change events on a custom EventBridge bus. A rule there should invoke a Lambda function, but the function never runs. A sample event has detail-type EC2 Instance State-change Notification, while the rule requires detail-type EC2 Instance State Change. What is the first fix?
Select an answer to reveal the explanation.
Short Explanation
EventBridge is a picky mailroom: if the label on the package is not the label on your rule, the package sits there. You copy the real detail-type into the pattern. S3 notifications are a different mailbox and will not catch an EC2 state change.
Full Explanation
A rule runs only when the event matches its pattern. The sample event's detail-type is EC2 Instance State-change Notification, and the rule demands a different string, so the event is not selected and Lambda is never invoked. Aligning the pattern with the event is the first fix. Lambda does not need a public listener for EventBridge to invoke it; the invoke is an AWS API call, and a public port would be a separate exposure. S3 event notifications fire on bucket activity, not on EC2 instance state changes. CloudTrail is not what duplicates this event into the bus, and disabling it removes audit history without making the pattern match. Caveat: after the pattern matches, the Lambda resource policy still has to trust events.amazonaws.com, or the invoke fails next. Operational check: use the sample event against the rule pattern, confirm a match, and then see an invocation in the function's metrics.