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 -
https://docs.aws.amazon.com/lambda/la...
As a demonstration, I have used pymysql (https://pypi.org/project/pymysql/) 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.
On this page of the site you can watch the video online Lambda : Layers - How to add pymysql module as your function layer? with a duration of hours minute second in good quality, which was uploaded by the user Saborni Bhattacharya 02 September 2023, share the link with friends and acquaintances, this video has already been watched 3,326 times on youtube and it was liked by 52 viewers. Enjoy your viewing!