Re:The Case of the Broken Lambda
by lostmsu on Monday September 24, 2018 @01:06PM
(#18059360)
TL;DR; It's not trivial to add a native binary (from Python package) to a Lambda function.
[ Parent
| on HN ]
Batteries included, except when it's not :)
Cross platform Python is tough, especially when you use dynamically linked C libs on a platform that can change versions without warning.
TL;DR; it's trivial.
Run `docker run --name lambdapy36 -it -v $(shell pwd):/mycode lambci/lambda:build-python3.6 /bin/sh -c "pip install -r /mycode/requirements.txt -t /mycode/vendored/"`
All your packages are now compiled for the lambda env and have been placed in the /mycode/vendored folder. Either move them into the root before deploy or add /var/task/vendored to Lambda's python path by setting PYTHONPATH: "/var/runtime:/var/task/vendored"