Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lambda Access Denied on S3 PutObject

I created a new S3 bucket, and left all defaults in place. I am trying to write an object to the bucket from a lambda function using the PutObject method. No matter what policies I attach or what I do, I get "access denied" on the action, unless I edit the bucket ACL and make it fully public. Obviously this isn't a very good solution. I really don't know what's going on: I know I've done this before without any special settings. The lambda and S3 bucket are both in the same account, and the role assigned to the lambda has the AWSLambdaFullAccess policy attached. I'm going crazy, any help would be appreciated.

like image 756
LandonC Avatar asked Oct 17 '22 08:10

LandonC


1 Answers

Unfortunately "s3:PutObject" is not enough to make it running - you will keep getting 403 Access denied error.

You should add "s3:PutObjectAcl" policy to your Lambda role.

like image 52
Michał Urbaniak Avatar answered Oct 21 '22 01:10

Michał Urbaniak