Making a Lambda Layer

Create a new virtual environment

python3 -m venv venv
source venv/bin/activate

Install the package in the virtual environment

pip install slack_sdk

Make a directory called python and move the lib directory in there

mkdir python
mv venv/lib python

Zip up python directory

Go to Finder → Compress

OR

zip -r python.zip python

Create the lambda layer

image

Select compatible runtimes

image

Make SURE the compatible runtimes match the folder name in lib ‼️

image

Create a new layer in the console

image

Add a lambda layer

Screenshot 2024-07-11 at 3 53 57 PM

Select lambda layer

image