-
-
Save TheRockStarDBA/84788d91c5a710341254762f9598af79 to your computer and use it in GitHub Desktop.
Deploys Python Scrapy library to an AWS Lambda layer. You can specify the region, library version, and runtime.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REGION=eu-west-1 | |
VER=1.7.3 | |
RUNTIME=python3.7 | |
docker run -v $(pwd):/out -it lambci/lambda:build-$RUNTIME \ | |
pip install scrapy==$VER -t /out/build/scrapy/python | |
cd build/scrapy | |
zip -r ../../scrapy.zip python/ | |
cd ../.. | |
aws lambda publish-layer-version \ | |
--layer-name Scrapy \ | |
--region $REGION \ | |
--description $VER \ | |
--zip-file fileb://scrapy.zip \ | |
--compatible-runtimes $RUNTIME | |
rm -rf build *.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment