简体   繁体   English

AWS Lambda-创建缩略图

[英]AWS Lambda - Create Thumbnail

I am using AWS Lambda for creating resized thumbnails. 我正在使用AWS Lambda创建调整大小的缩略图。 The source is an S3 bucket and the destination is another S3 bucket. 源是一个S3存储桶,目的地是另一个S3存储桶。 I was able to create the lambda function from Amazon CLI. 我能够从Amazon CLI创建lambda函数。 The function is triggered whenever a new image is added to the source bucket. 每当将新图像添加到源存储桶时,都会触发该功能。 But, the resize/thumbnail creation is not working. 但是,调整大小/创建缩略图不起作用。 I can see some issue in the CloudWatch Console. 我可以在CloudWatch控制台中看到一些问题。

The content of the uploaded ZIP package is: 上传的ZIP包的内容为:

CreateThumbnail.js, node_modules CreateThumbnail.js,node_modules


Unable to import module 'CreateThumbnail': Error
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/var/task/CreateThumbnail.js:2:13)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

Best regards, BP 最好的问候,BP

Finally able to find the source of the bug. 终于能够找到该错误的来源。 The command used to make the zip file was causing the issue. 用于制作zip文件的命令导致了此问题。

The correct command is: zip -r CreateThumbnail.zip * 正确的命令是:zip -r CreateThumbnail.zip *

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM