boto3版本不匹配似乎在使用awslambda使用create_function()方法时会导致错误

发布于 2025-02-07 04:58:11 字数 1356 浏览 3 评论 0原文

我正在遇到一个问题,以编程方式创建AWS lambda函数。我得到的错误是

botocore.exceptions.paramvalidationerror:参数验证失败: Unknown parameter in input: "RunTime", must be one of: FunctionName, Runtime, Role, Handler, Code, Description, Timeout, MemorySize, Publish, VpcConfig, PackageType, DeadLetterConfig, Environment, KMSKeyArn, TracingConfig, Tags, Layers, FileSystemConfigs, ImageConfig,CodeSigningConfigarn,架构,临时性

研究后,我发现了此AWS页面( https://aws.amazon.com/premiumsupport/knowledge-center/lambda-python-python-runtime-errors/ ),这表明我需要升级boto3和botocore,我需要对此进行升级最新版本如我的pip列表中所示。

Package               Version
--------------------- ---------
awscli                1.25.8
boto                  2.49.0
boto3                 1.24.8
botocore              1.27.8

但是,当我本地运行脚本并使用以下命令运行脚本时,存在不匹配:

print(boto3.__version__)
print("botocore version:"+botocore.__version__)

1.24.4
botocore version:1.27.4

我如何强制我的脚本运行最新版本的boto3/botocore,假设这是我无法在代码中创建lambda函数的原因。

I am having an issue creating a AWS Lambda function programmatically. The error I get is

botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in input: "RunTime", must be one of: FunctionName, Runtime, Role, Handler, Code, Description, Timeout, MemorySize, Publish, VpcConfig, PackageType, DeadLetterConfig, Environment, KMSKeyArn, TracingConfig, Tags, Layers, FileSystemConfigs, ImageConfig, CodeSigningConfigArn, Architectures, EphemeralStorage

After a bit of research I found this AWS page(https://aws.amazon.com/premiumsupport/knowledge-center/lambda-python-runtime-errors/) that suggests that I needed to upgrade boto3 and botocore, which I did to the latest version as shown in my pip list.

Package               Version
--------------------- ---------
awscli                1.25.8
boto                  2.49.0
boto3                 1.24.8
botocore              1.27.8

However, there is a mismatch when I run the script locally and with the following commands:

print(boto3.__version__)
print("botocore version:"+botocore.__version__)

1.24.4
botocore version:1.27.4

How do I force my script to run the latest version of boto3/botocore, assuming that is the reason I can't create the Lambda function in code.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁吢 2025-02-14 04:58:11

lambda developer Guide 提供有关如何包装包装的说明您的python功能,包括有关如何拉链依赖项的详细信息。

The Lambda developer guide gives instructions on how to package your Python function, including details on how to zip up dependencies.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文