I\'ve got a Python script for an AWS Lambda function that does HTTP POST requests to another endpoint. Since Python\'s urllib2.request
, https://docs.python.org/2/li
Amazon's Serverless Application Model (SAM) provides a build command that can bundle arbitrary python dependencies into the deployment artifact.
To be able to use the requests
package in your code, add the dependency to your requirements.txt file:
requests==2.22.0
then run sam build to get an artifact that vendors requests
. By default, your artifacts will be saved to the .aws-sam/build
directory but another destination directory can be specified with the --build-dir
option.
Consult SAM's documentation for more info.