I am trying to get up and running with AWS Lambda Python (beginner in Python btw) but having some problems with including MySQL dependency. I am trying to follow the instruc
Using lambda-docker you can set up and test your Lambda functions without access to a like-wise Linux environment.
To set up your lambda, use a lambda-docker build image to run a detached docker container and run pip install
commands on the container. Then export the container, grab the installed packages under usr/lib
, and place them in your AWS Lambda package.
Then you can test for compatibility by running your lambda on a lambda-docker image. If it works, go forth and upload to AWS Lambda with confidence.
docker run -d -v "$PWD":/var/task lambci/lambda:build-python2.7 tail -f /dev/null
docker ps
docker exec 0c55aae443e6 pip install pandas
docker exec 0c55aae443e6 pip install sqlalchemy
docker exec 0c55aae443e6 pip freeze
docker exec 0c55aae443e6 python -c "import site; print(site.getsitepackages())"
docker container export -o lambda_ready_container 0c55aae443e6