You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
As your serverless applications grow, you need strategies for sharing code across functions and externalising configuration. Lambda Layers let you package shared libraries, custom runtimes, and common utilities separately from your function code. Environment variables provide a mechanism for injecting configuration without modifying code.
A Lambda Layer is a ZIP archive containing libraries, a custom runtime, or other dependencies. Layers are extracted to the /opt directory in the execution environment and are available to your function code at runtime.
Execution Environment
+------------------------------------------+
| /opt/ |
| ├── nodejs/node_modules/ (Layer 1) |
| ├── python/lib/ (Layer 2) |
| └── custom-bin/ (Layer 3) |
| |
| /var/task/ |
| └── index.mjs (Your code) |
+------------------------------------------+
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.