AWS Certified Developer – Associate (DVA-C02) — Question 118
A developer has created an AWS Lambda function to provide notification through Amazon Simple Notification Service (Amazon SNS) whenever a file is uploaded to Amazon S3 that is larger than 50 MB. The developer has deployed and tested the Lambda function by using the CLI. However, when the event notification is added to the S3 bucket and a 3,000 MB file is uploaded, the Lambda function does not launch.
Which of the following is a possible reason for the Lambda function's inability to launch?
Answer options
- A. The S3 event notification does not activate for files that are larger than 1,000 MB.
- B. The resource-based policy for the Lambda function does not have the required permissions to be invoked by Amazon S3.
- C. Lambda functions cannot be invoked directly from an S3 event.
- D. The S3 bucket needs to be made public.
Correct answer: B
Explanation
The correct answer is B because the resource-based policy for the Lambda function needs to allow permissions for Amazon S3 to invoke it. Option A is incorrect as S3 event notifications can trigger for files larger than 1,000 MB. Option C is wrong since Lambda functions can be invoked by S3 events. Option D is not relevant, as the bucket's public status does not affect Lambda invocation permissions.