Home > Blockchain >  Boto3 version mismatch seemingly causing error when using create_function() method with AWSLambda
Boto3 version mismatch seemingly causing error when using create_function() method with AWSLambda

Time:06-15

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.

CodePudding user response:

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

  • Related