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
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!
That's interesting! How do you actually pin boto3 in a lambda? Do you end up bundling it with each deployment?