AWS Lambda Layers - Node Js

by Revathi Ganapuram Adding Layers in AWS Lambda Overview : A Lambda layer is an archive containing additional code, such as libraries, dependencies, or even custom runtimes. The layer later can be used by adding in Layers option in AWS Lambda. In this post, we will learn how to create and add layers for node js functions in AWS Lambda. Firstly, we will create a sample code of printing current data and time like below For this we have created a folder named AWSLAYERS , in that we have added initialized 'npm init'. Next, for printing date and time we need moment module, let's install it. npm install moment --save. After successful installation of `moment` a node module package will be created inside folder and also package.json file. Now here comes the actual part, create a folder names 'nodejs' and move nodemodules, package.json (package-lock.json also , if present) inside nodejs folder. After moving the folder structure should be as below. ...
Comments
Post a Comment