Part 1 — Getting started with AWS Lambda Layers

Dhaval Nagar
May 31 · 4 min read

A function can use up to 5 layers at a time. The total unzipped size of the function and all layers can’t exceed the unzipped deployment package size limit of 250 MB.

Layer Setup

$ mkdir momentjs-layer && cd momentjs-layer
$ npm init -y
$ npm install --save moment
"scripts": {
    "build": "npm install && mkdir -p nodejs && cp -r node_modules nodejs/ && zip -r moment-layer.zip nodejs"
}

Create Lambda Layer

Integrating Layer in Lambda Function

{
  "statusCode": 200,
  "body": "\"Hello from Lambda!, Happy Tuesday\""
}

AppGambit

Web and Mobile Development Co Based in India

Dhaval Nagar

Written by

8x AWS Certified, 2x Google Cloud Certified, Founder@AppGambit, Startup Enthusiast, ♥ building new stuff, ♥ JavaScript,

AppGambit

AppGambit

Web and Mobile Development Co Based in India