Use Lambda layers to package code and dependencies that you want to reuse across multiple functions. Layers usually contain library dependencies, a custom runtime, or configuration files.
Below are the steps to create lambda layer and test it with lambda function.
- mkdir lambda_layer
- mkdir -p python
- pip install requests -t ./python --python-version 3.14 --only-binary=:all:
- Zip python directory.
- Go to AWS and create Lambda layer by uploading python.zip file.
- Create lambda function with the same runtime version eg. 3.13 and attach lambda layer to it.
- import module required modules in lambda_function.py handle file
- Test the function by creating test event.

Top comments (0)