AWS Certified Developer – Associate / Question #640 of 557

Question #640

A developer has configured an AWS Lambda function to process data files uploaded to an Amazon S3 bucket. The Lambda function is designed to trigger whenever a new .csv file larger than 100 MB is uploaded. The developer tested the function by uploading a 150 MB .csv file via the AWS CLI, and it executed successfully. However, when a user uploads a 200 MB .csv file through the S3 console, the Lambda function does not trigger.

Which of the following is a possible reason for this failure?

A

S3 event notifications do not support console uploads for files larger than 100 MB.

B

The resource-based policy for the Lambda function does not allow Amazon S3 to invoke it.

C

Lambda functions cannot be triggered by S3 events for objects stored in the Standard storage class.

D

The S3 bucket's lifecycle policy is set to transition objects to Glacier immediately.

Explanation

The correct answer is B. For Amazon S3 to invoke a Lambda function, the Lambda's resource-based policy must explicitly allow S3 to invoke it. If this permission is missing, S3 event notifications cannot trigger the Lambda. The developer's test via CLI worked because the policy might have been temporarily granted or manually configured during testing, but it could be missing in the production setup. Other options are incorrect:
- A: S3 event notifications work for console uploads regardless of size.
- C: Lambda can be triggered by S3 events for any storage class.
- D: Lifecycle policies affect object storage but do not block event triggers.
Key takeaway: Always verify the Lambda resource policy allows 's3.amazonaws.com' to invoke the function when using S3 event triggers.

Answer

The correct answer is: B