node.js - AWS CloudFormation 与 node.js 10.x 更新错误 "ZipFile can only be used when Runtime is set to <older node.js versions>"

标签 node.js amazon-web-services aws-lambda aws-serverless aws-sdk-nodejs

我们正在使用 CloudFormation 模板在 Lambda 函数上部署一些中间代码。

我们正在使用 ZipFile 函数通过 CloudFormation 添加内联代码。

lambda 函数的当前运行时是 node.js 8.10。 我们需要将 Node 版本更新到10.x。

使用 cloudformation 更新 Lambda 时,我们收到以下错误:

ZipFile can only be used when Runtime is set to either of nodejs, nodejs4.3, nodejs6.10, nodejs8.10, python2.7, python3.6, python3.7.

最佳答案

我认为这是一个已知问题。 https://forums.aws.amazon.com/thread.jspa?threadID=303166&tstart=0 截至撰写本文时,这仍然是一个问题。我的建议是在 S3 存储桶中包含 super 基本代码并引用该代码,而不是使用 zip 文件,并在创建 lambda 函数后部署实际代码。或者,您可以将 zip 工件上传到 S3 存储桶。如果您的代码是专有的,请小心 S3。

关于node.js - AWS CloudFormation 与 node.js 10.x 更新错误 "ZipFile can only be used when Runtime is set to <older node.js versions>",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57572955/

相关文章:

node.js - Slackbot( Node ): icon_emoji feature not working

python - 从 boto3 访问 DynamoDB Local

PHP用数组插入sql

python - 使用字符集编码 UTF-8 发送电子邮件 - Python + boto3

Node.JS - 在中间件的末尾获取发送的数据

node.js - 在 index.html 中加载 angular app-root 时未显示 mat-spinner

javascript - 浏览器与 gulp 和 Ghost 博客同步

python - SSM 向 EC2 实例发送命令失败

python - 对已使用无服务器推出的 lambda 函数设置重试策略

amazon-web-services - 将附加值传递给 s3 事件通知以用于 lambda 消耗