我想在AWS lambda中部署我的节点应用程序。我使用的npm包并没有预装在lambda中。那么我如何在lambda中部署整个节点应用呢?有一个选项可以将文件作为zip文件上传。但是如何构建正确的lambda文件系统呢?
发布于 2019-12-27 20:45:20
您需要压缩文件内容。基本上
somezip.zip
node_modules
index.js
anyotherffile.js
package.json上传zip并调用已公开的处理程序函数。
您还可以使用诸如- https://www.npmjs.com/package/serverless之类的框架
发布于 2019-12-27 20:46:17
我建议你去看看AWS reference documentation。可以执行以下步骤:
~/my-function$ npm install~/my-function$ zip -r function.zip .~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip在following page from AWS上查找可用的节点环境。请注意适用的限制,截至2019年12月27日,如果部署包大于50 MB,您必须使用亚马逊S3。
https://stackoverflow.com/questions/59500927
复制相似问题