Lambda S3 Put函数不会触发较大文件 [英] Lambda S3 Put function not triggering for larger files

查看:94
本文介绍了Lambda S3 Put函数不会触发较大文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在探索将电子邮件附件与.eml文件本身分开存储.我有一个SES规则集,可将入站电子邮件传递到存储桶.存储桶检索电子邮件时,S3 Put Lambda函数将解析原始电子邮件(MIME格式),base64解码附件缓冲区,并对每个附件和原始.eml文件执行putObject到新存储桶.

I am currently exploring storing the attachments of an email separately from the .eml file itself. I have an SES rule set that delivers an inbound email to a bucket. When the bucket retrieves the email, an S3 Put Lambda function parses the raw email (MIME format), base64 decodes the attachment buffers, and does a putObject for each attachment and the original .eml file to a new bucket.

我的问题是,此Lambda函数不会触发附件超过3-4 MB的电子邮件.电子邮件已接收并存储在初始存储桶中,但是在接收到该功能时不会触发.此外,该事件不会出现在CloudWatch中.但是,使用硬编码的S3 Put有效负载手动测试该功能时,以及将.eml文件手动上传到分配的存储桶时,该功能都可以正常工作.

My problem is that this Lambda function does not trigger for emails with attachments exceeding ~3-4 MB. The email is received and stored in the initial bucket, but the function does not trigger when it is received. Also, the event does not appear in CloudWatch. However, the function works perfectly fine when manually testing it with a hardcoded S3 Put payload, and also when manually uploading a .eml file to the assigned bucket.

您知道为什么会有此限制吗?也许这是存储分区的权限问题,或者是分配的Lambda角色问题?手动测试时,我发现这绝不是超时或超过已用最大内存的问题.

Do you have any idea why there is this limitation? Perhaps this is a permission issue with the bucket or maybe an issue with the assigned Lambda role? When manually testing I’ve found this is by no means a timeout or exceeding max memory used issue.

推荐答案

几乎可以肯定,较大的文件是通过S3分段上传而不是常规的Put操作上传的.您需要将Lambda订阅配置为也可以收到分段上传的通知.听起来该函数当前仅预订了 s3:ObjectCreated:Put 事件,并且您需要将 s3:ObjectCreated:CompleteMultipartUpload 添加到配置中.

The larger files are almost certainly being uploaded via S3 Multipart Upload instead of a regular Put operation. You need to configure your Lambda subscription to also be notified of Multipart uploads. It sounds like the function is only subscribed to s3:ObjectCreated:Put events currently, and you need to add s3:ObjectCreated:CompleteMultipartUpload to the configuration.

这篇关于Lambda S3 Put函数不会触发较大文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆