hands-on lab

Integrating Lambda Layers with the Serverless Framework

Difficulty: Intermediate
Duration: Up to 1 hour
Students: 244
Rating: 3.4/5
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.

Description

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

Prerequisites

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

Covered topics

Lab steps

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