Workaround after removal of vendored version of botocore

0

Customer uses botocore.vendored that are impacted by the upcoming changes:

https://aws.amazon.com/blogs/developer/removing-the-vendored-version-of-requests-from-botocore/

In their words: The main problem is that when using python in a Lambda, you were not able to import requests, hence us using botocore.vendored.

Do you know how to use requests now when in a Lambda function?

AWS
asked 4 years ago1097 views
1 Answer
0
Accepted Answer

You can create a Lambda Layer for the requests library:

https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html

or you can include your dependencies within your Lambda artifact upon upload, which would look something like:

https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html#python-package-dependencies

In the second route, you would just include the version of requests in the requirement file before you run pip.

AWS
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions