boto3版本不匹配似乎在使用awslambda使用create_function()方法时会导致错误
我正在遇到一个问题,以编程方式创建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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.