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 年前檢視次數 1178 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南