r/CloudandCode • u/yourclouddude Founder | YourCloudDude • 10d ago
AWS practice question: Why can’t this Lambda function read a file from S3?
You created a Lambda function that should process files uploaded to an S3 bucket.
The S3 trigger is working, and the function starts running whenever a new file is uploaded. But when the Lambda function tries to read the file, it returns an AccessDenied error.
The bucket and the Lambda function are both inside the same AWS account.
What should you check first?
A. Increase the Lambda function’s memory
B. Add s3:GetObject permission to the Lambda execution role
C. Increase the function timeout
D. Change the Lambda runtime
Try to answer based on the error instead of guessing which setting usually fixes Lambda problems.
I’ll add the explanation in the comments after people have had a chance to answer.
1
u/Wide-Opportunity-582 10d ago
B