我们正在使用 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/