- Newest
- Most votes
- Most comments
Hi Aka,
To confirm, your code to PUT into S3 works locally but not when the code is uploaded to Lambda? But other lambda functions work as long as they're not uploading to S3? And confirming that the credentials you used are only used when running locally?
It looks like Lambda doesn't have the required permissions. Lambda would need to have an associated role to access S3, this is separate from the IAM user you created.
The detailed instructions on how to create the role and associate it with your function is below: https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html
Hi,
You may want to follow this guidance about 500s in Lambda to troubleshoot your issue: https://repost.aws/knowledge-center/lambda-troubleshoot-invoke-error-502-500
Best,
Didier
Hello, i don't know what is the problem in my case, but i think it related to this problem: KMSAccessDeniedException But in my server, i'm using Access Key and Secret Key created from IAM user. And i cannot access the S3 due to unknown error with this Access Key
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 3 years ago

Hello Lance. I followed the docs and created a role with these permission: AmazonS3FullAccess, AmazonS3ObjectLambdaExecutionRolePolicy, AWSLambdaVPCAccessExecutionRole. Then i updated lambda's execution role to this role. I called the api upload image again but seems like it didn't work, same error 500 as before.