In this video, I have talked about Lambda Layers which are zip archive file comprising of a custom runtime or additional dependency modules or binaries required by your function code. Layers can be shared across multiple functions. If you want to know more, please refer to this public document -
docs.aws.amazo...
As a demonstration, I have used pymysql (pypi.org/proje...) module that can be used as a client in your function with python runtime to connect to MySQL database. Here are the abridged steps -
$ mkdir python
$ cd python
$ pip3 install pymysql -t .
$ cd ..
$ chmod -R 755 python/
$ zip -r pymysql-layer.zip python/
$ aws s3 cp pymysql-layer.zip s3://YOUR-BUCKET/FOLDER
The above commands holds true for function with python runtime and for packages that is supported in Amazon Linux environments. Then follow the steps as specified in the public documentation of layers either using CLI command or Web console.
NOTE - Not endorsed by AWS, all opinions are mine.
Негізгі бет Lambda : Layers - How to add pymysql module as your function layer?
No video
Пікірлер: 11