An EventBridge rule matches events and uses an input transformer to invoke a Lambda function, but failed events reach its dead-letter queue with NO_PERMISSIONS; the function has no invocation logs. The function's execution role permits logging, and the target ARN is correct. Which change restores delivery while restricting invocation to this rule?
Show the answer
Correct answerA. Allow events.amazonaws.com in the function's resource policy, conditioned on the rule ARN.
AWhy this is right: The EventBridge service principal needs resource-based invocation permission, restricted by the source rule ARN.
BWhy not this: The invoking service is EventBridge, so the required principal is events.amazonaws.com rather than lambda.amazonaws.com.
CWhy not this: An event bus policy controls access to the bus; it does not grant invocation access to a Lambda function.
DWhy not this: The execution role grants permissions to running function code; it does not authorize EventBridge to invoke the function.
EventBridge needs permission in the Lambda function's resource-based policy, with events.amazonaws.com as the principal and the rule ARN as a source condition. The function's execution role controls what its code can access, not who can invoke it.