This repository contains AWS Lambda Layers that can be reused across multiple Lambda functions. Lambda Layers allow you to manage dependencies and share code more efficiently. This guide will explain how to create, package, and deploy your own Lambda Layer.
A Lambda Layer is an archive containing libraries, a custom runtime, or other dependencies that you can import into your Lambda functions. It allows you to share common code across multiple functions, reducing the package size and simplifying updates.
- Python: Use the same version as your lambda to avoid conflicts.
- WSL or Linux: To use the bash commands for the layer zip creation. Some Windows systems have problems with it.
- ZIP utility: The packaging process involves zipping files, so you need a tool to create ZIP archives (e.g.,
zip
command on Linux/macOS,7-Zip
on Windows).
Create a directory that will contain your layer code and its dependencies. The folder structure depends on the runtime of your Lambda function:
mkdir python
cd python
pip3 install pandas -t .
tree -L 1
zip -r pandas_layer.zip .
ADD PRINT HERE
ADD PRINT HERE