1.x Lambda Layer

Lambda Layers are a convenient way to manage common dependencies between different Lambda Functions.

We will build and deploy a Lambda layer that will be used in the code that creates our training data.

Create Lambda Layer

You can build the Lambda Layer yourself or use a premade layer in the next step.

Build Lambda Layer

The following set of (Linux) commands will create a layer of this package alongside puppeteer-core:

git clone --depth=1 https://github.com/jacobcantwell/chrome-aws-lambda.git && \
cd chrome-aws-lambda && \
make chrome-aws-lambda.zip

The above will create a chrome-aws-lambda.zip file, which can be uploaded to your Layers console.

Deploy Lambda Layer

Open AWS Lambda Layers

Open Layers

Open Create layer

Create layer

  • Enter Name - chrome-aws-lambda
  • Description - chrome-aws-lambda
  • Upload a .zip file - select the lambda layer chrome_aws_lambda.zip file
  • Select compatible runtimes - Select Node.js 12.x
  • Select Create

Create layer

You should see Lamba Layer was successfully created

Layer successfully created

Open Lambda to continue. In the next step we will create a Lambda Function that will generate the training data images.