An S3 bucket must invoke a Lambda function only for events from that bucket in the expected account. Which function-policy configuration meets this requirement?
Show the answer
Correct answerA. Grant the S3 service permission conditioned on source ARN and source account.
AWhy this is right: The service principal permits S3 invocation, while source conditions restrict the originating bucket and account.
BWhy not this: The invoking principal is the S3 service, not the bucket owner's root principal.
CWhy not this: S3 invokes the function; allowing the Lambda service does not authorize S3 event delivery.
DWhy not this: Execution-role permissions govern the function's outbound access, not incoming invocation authorization.
The function's resource-based policy should allow s3.amazonaws.com to invoke it, restricted by AWS:SourceArn and AWS:SourceAccount. The execution role controls what the function can do after invocation, not which S3 bucket may invoke it.