How to Manage Boto3 Versions in AWS Lambda and Layers

0
1
Asked By CuriousCoder92 On

I'm working with Python in an AWS Lambda setup and facing some versioning issues. Whenever I update my Lambda layer, which relies on botocore (specifically PynamoDB), it gets updated. Meanwhile, if I also update the Lambda itself, it updates boto3 and botocore as well. This leads to conflicts where the botocore version utilized in the layer is older than what's in the Lambda, resulting in errors like `TypeError: Session.create_client() got an unexpected keyword argument 'aws_account_id'`. How do others deal with managing boto3 versions across Lambda functions and layers?

1 Answer

Answered By VersionGuardianX On

The key here is to pin your versions. Relying on your deployment pipeline to always pull the latest versions may lead to issues down the line that have nothing to do with your layers. Always stick to the versions that you know work together!

LambdaLearner77 -

That's interesting! How do you actually pin boto3 in a lambda? Do you end up bundling it with each deployment?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.