hands-on lab

Integrating Lambda Layers with the Serverless Framework

Up to 1h
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.


If you are building different microservices, you should fall into the scenario where you have to install the same library and/or package on the microservices. This could become painful when you have dozens of services to handle and maintain. A good solution would be to have the microservices pointing to a single entity that acts as a container for the packages used in the microservices.

You can leverage AWS Lambda Layers with the Serverless Framework to achieve this result. A Lambda Layer is a container where you can put any kind of dependency that will be used from the Lambda functions. After creating it, you only need to link the Lambda to the Layer.

In this lab, you will use the Serverless Framework to integrate a public Lambda Layer and to deploy a function that leverages it.

Learning Objectives

Upon completion of this lab you will be able to:

  • Integrate a Lambda Layer through the Serverless Framework
  • Link Lambda functions to the Layer you create

Intended Audience

This lab is intended for:

  • Software engineers mainly focused on serverless development
  • Developers that need a solution to share packages across different services


To get the most from this lab, you should have basic knowledge of the Serverless Framework. To get ready, you can use the following labs:

Environment before

Environment after

About the author

Learning paths

Stefano studies Computer Science and is passionate about technology. He loves working with Cloud services and learning all the best practices for them. Google Cloud Platform and Amazon Web Services are the cloud providers he prefers. He is a Google Cloud Certified Associate Cloud Engineer. Node.js is the programming language he always uses to code. When he's not involved in studying or working, Stefano loves riding his motorbike and exploring new places.

Covered topics

Lab steps

Initializing a Project Using the Serverless Framework
Releasing and Integrating the Lambda Layer
Testing the Lambda with the Integrated Layer