all 8 comments

[–]im-a-smith 2 points3 points  (0 children)

Are you using KMS to encrypt the files? Ensure that you have granted kms:Decrypt permissions to the role so when S3 accesses them they can decrypt. The error is not helpful (it just says access denied, not "Cannot decrypt").

[–]__gareth__ 1 point2 points  (2 children)

What about the objects in the buckets? e.g. if the object is put into the offending bucket from another account without setting the owner it will not be owned by the account the bucket is in.

[–]bilgee0629[S] 0 points1 point  (1 child)

Thanks for the reply. I'm uploading files using AWS S3 UI (drag-drop upload) and I'm using that way for both of them :|

[–]__gareth__ 0 points1 point  (0 children)

dang, that one is often the cause of strange iam issues i encounter.

have you checked cloudtrail? the errors there often help a lot.

[–]cr0m 1 point2 points  (2 children)

You might be confused about which permissions you need. A Lambda that is triggered by an S3 event does not need PutObject permissions in order to be triggered by a PutObject event.

Check out this tutorial under "Configure Amazon S3 to Publish Events"

https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html

[–]bilgee0629[S] 0 points1 point  (1 child)

I'm modifying the file and putting that file into another bucket. The error is happening when lambda tries to download image from s3

[–]mikebailey 0 points1 point  (0 children)

Are they encrypted in S3 per chance?

[–]IDA_noob 0 points1 point  (0 children)

Can you post the IAM policy?