Why is my S3 Lambda Trigger not executed for larger objects uploaded to S3 with KMS key

0

When uploading a large file (I tried it with 60 MB) to S3 using e.g. browser upload with an AWS KMS managed customer master key (SSE-KMS)(!), no 'ObjectCreated'-Events will be triggered. As a consequence an attached lambda function won't trigger.

The same setup works without any kind of issues when uploading smaller files (I tried it with 2MB) That is quite strange and I wonder, why it has not been fixed yet. Can you provide guidance here?

Further evidence next to my own observation:

https://stackoverflow.com/questions/67917878/aws-s3-lambda-function-doesnt-trigger-when-upload-large-file#comment125169885_67917878

https://stackoverflow.com/questions/61125071/lambda-not-invoking-if-the-uploaded-files-are-large-in-size-in-s3-bucket#comment125169907_61125071

https://forums.aws.amazon.com/thread.jspa?messageID=588242&#588242 (last post)

Since no one was able to provide an answer that actually tackles the problem in those posts, it looks like this a bug to me. In that case I would suggest to fix it :)

  • Is the event you're listening for "s3:ObjectCreated:*", specifically with the wildcard on the end?

  • I just used the web-interface to set it up. There is no option to define any wildcards. https://paste.pics/FRKFU

    When looking at the trigger details (within the lambda function's trigger configuration) it just says: "Event type: ObjectCreated"

  • For the sake of completeness I added a second trigger for the Multipart Upload (see screenshot). As assumed there was no change in behavior: https://paste.pics/FRKRU As stated I am using an AWS KMS managed customer master key (SSE-KMS) on the bucket and for the upload

  • Does the lambda function need the "AmazonS3ReadOnlyAccess" Policy to allow invocation via S3 multipart upload trigger?

1개 답변
0

Expanding on the comment by @mike, your small files would be uploaded in one piece whereas large ones (over 5MB) would be multi-part uploads that are different API calls. So depending how you defined your trigger conditions you could be picking up one but not the other.

전문가
답변함 3년 전
  • I just used the web-interface to set it up. There is no option to define any wildcards. https://paste.pics/FRKFU

    When looking at the trigger details (within the lambda function's trigger configuration) it just says: "Event type: ObjectCreated"

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠