Here is good reference for this subject:
https://aws.amazon.com/premiumsupport/knowledge-center/lambda-layer-simulated-docker/
https://dev.to/matthewvielkind/creating-python-aws-lambda-layers-with-docker-4376
If we use docker then it's very simple.
Let's go through step by step
1. make Main folder & python library folder
ex) In this tutorial, we suppose to need flask package
2. make requirements.txt and put packages to install by pip
So folder structure looks like this:
├── requirements.txt └── python/ └── lib/ ├── python3.6/ │ └── site-packages/ └── python3.8/ └── site-packages/
3. Run docker to install packages
note, change python version properly
4. compress package to zip
5. use zip file for your lambda
That's it all.
Thank you.
www.marearts.com
๐๐ป♂️
No comments:
Post a Comment