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
질문됨 4년 전1177회 조회
1개 답변
0
수락된 답변

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
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠