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

EXPERTO
respondido hace 3 años
  • 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"

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas