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 Antwort
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.

EXPERTE
beantwortet vor 2 Jahren
  • 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"

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen