Publish simple Node.js AWS Lambda layer

--

Let’s provide axios as a Lambda layer

Prerequisites

  • AWS account
  • npm
  • zip

1. Create folder

mkdir nodejs
cd nodejs

2. Install dependency

npm install axios

3. Zip contents

cd ..
zip -r axios.zip nodejs

4. Publish to Lambda layers

Create new layer
Add previously created axios.zip
Copy full ARN since we will need it in the next step

5. Add to existing Lambda

Open existing lambda and click to add a layer
Add layer via previously added ARN

6. Let’s check if it works

It pulls info from public API using axios

You can find list of commands down below:

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Responses (1)

Write a response