Everynode allows you to run any version of Node.js in AWS Lambda, in any commercial AWS region

Overview

Fusebit

Run Any Node.js Version in AWS Lambda

Everynode allows you to run any version of Node.js in AWS Lambda, in any commercial AWS region. We add support for new Node.js versions within six hours of the release.

Run Any Node.js Version in AWS Lambda

  • Create and run AWS Lambda functions using any version of Node.js >= 11.
  • New releases of Node.js are supported within 6 hours.
  • Deploy to any commercial AWS region.
  • No magic or tricks - open source.
  • Free forever, created and maintained for developers like you by developers at Fusebit.

Quickstart

Let's deploy a Hello, World Lambda function using Node.js 17.5.0 to us-west-1.

First, create the Lambda deployment package:

cat > function.js <<EOF
exports.handler = (event, context, callback) => {
  callback(null, { message: "Hello from Node " + process.version });
};
EOF

zip function.zip function.js

Next, create the hello17 Lambda function in us-west-1 that uses a custom Lambda runtime with Node.js v17.5.0 provided by Fusebit:

# Get the ARN of the custom runtime layer containg Node.js 17.5.0 for us-west-1
LAYER=$(curl https://cdn.fusebit.io/everynode/layers.txt --no-progress-meter | grep 'us-west-1 17.5.0' | awk '{ print $3 }')

# Create a Lambda function using Node.js 17.5.0
aws lambda create-function --function-name hello17 \
  --layers $LAYER \
  --region us-west-1 \
  --zip-file fileb://function.zip \
  --handler function.handler \
  --runtime provided \
  --role {iam-role-arn}

Last, call the function:

aws lambda invoke --function-name hello17 response.json
cat response.json

And voila, welcome to Node.js v17.5.0 in AWS Lambda:

{ "message": "Hello from Node v17.5.0" }

Any Region, Any Node.js Version, One Lambda

The Everynode project provides pre-built AWS Lambda layers that contain custom AWS Lambda runtimes for every Node.js version >=11 in all commercial AWS regions. When you want to create a Lambda function using a specific Node.js version in a specific AWS region, you need to choose the right AWS layer for it.

Each combination of AWS region and Node.js version has a distinct layer ARN you need to use when deploying a Lambda function to that region. You can find the ARN of the layer you need from the catalog we publish:

Lambda layers for new Node.js versions are published generally within 6 hours after the Node.js release.

The JSON format of the catalog is convenient for programmatic use from your application. The text format is convenient for scripting. For example, you can get the AWS Lambda layer ARN for Node.js v17.4.0 in region us-east-1 with:

LAYER=$(curl https://cdn.fusebit.io/everynode/layers.txt --no-progress-meter | grep 'us-east-1 17.4.0' | awk '{ print $3 }')
echo $LAYER

Once you have the ARN of the layer matching your desired Node.js version and AWS region, you can provide it to the --layers option of the aws lambda create-function call, or specify it in the Layers array when making a direct API request.

FAQ

Is it really free?

Yes. Support for any version of Node.js in AWS Lambda is a by-product of the engineering behind Fusebit, our developer-friendly integration platform that helps devs add integrations to their apps.

How can I get in touch with feedback, questions, etc?

You can join our community Slack, Discord, or e-mail us. You can also reach us on Twitter @fusebitio. You can also file an issue in this repo.

How do I report an issue?

File an issue. Or better still, submit a PR.

What's included in the custom runtime?

Only the full release of Node.js (including node, npm, and npx). In particular, the aws-sdk module is not included. If you need to use it, you must include it in your Lambda deployment package.

Is ES6 supported?

Yes, Lambda handlers can be implemented as ES6 modules in Node.js >= 14.

Are you mining bitcoins in my AWS account?

We try not to. But since Everynode is OSS, you can check yourself. You can even deploy your own copies of the custom Lambda layers to your own AWS account.

Do you have cool stickers?

Yes. Get in touch and we will send you some.

Comments
  • Runtime.ErrorLoadingHandler when using es6 exports

    Runtime.ErrorLoadingHandler when using es6 exports

    I'm getting the following error:

    Unknown application error occurred
    Runtime.ErrorLoadingHandler
    

    And the only thing I'm changing between it working and this failure state is the node version. Previously I was using AWS' node14. Here's my js:

    // index.js
    export async function entry(event) {
      return {
        statusCode: 200,
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          result: 'success',
        }),
      };
    }
    

    tf:

    resource "aws_lambda_function" "api_api" {
      function_name = random_pet.lambda_api_function.id
    
      s3_bucket = aws_s3_bucket.api_bucket.id
      s3_key    = aws_s3_bucket_object.api_bucket_obj.key
    
      runtime = "provided"
      layers  = ["arn:aws:lambda:us-east-1:072686360478:layer:node-16_9_1:3"] # https://github.com/fusebit/everynode
      handler = "index.entry"
    
      source_code_hash = data.archive_file.lambda_api.output_base64sha256
    
      role = aws_iam_role.api_exec.arn
    
      tags = var.tags
    }
    
    opened by yspreen 7
  • Fusebit Logo Link

    Fusebit Logo Link

    There's a space in the Fusebit URL at the top of the README.md that the fuse bit logo links to.

    I tried a couple of different browsers, and neither of them would navigate to Fusebit, which means that people can't easily click through.

    I could make a PR, but a forking your codebase and making a PR to remove a single space is probably overkill. ;)

    opened by geoffreywiseman 1
  • Error when using with Cloudformation

    Error when using with Cloudformation

    I am using a AWS::Serverless::Function resource to deploy my Lambda function.

    I added arn:aws:lambda:eu-west-1:072686360478:layer:node-16_0_0:3 as a Layer to my function, and set runtime to provided.

    Deployed the stack, but when running the Lambda, I get

    Unknown application error occurred Runtime.ErrorLoadingHandler

    My cloudformation config for the Lambda

    MyLambdaFunction:
        Type: 'AWS::Serverless::Function'
        Description: create endpoint
        Properties:
          Handler: index.main
          CodeUri: ../.dist/lambda/Create/lambda.zip
          Runtime: provided
          Timeout: 5
          MemorySize: 768
          Role: !GetAtt LambdaRole.Arn
          Environment:
            Variables:
              REGION: !Ref AWS::Region
          Layers:
            - arn:aws:lambda:eu-west-1:072686360478:layer:node-16_0_0:3
            - !Ref Layer
    
    opened by paul-uz 0
  • Node 18 does not work

    Node 18 does not work

    When running on the new 18_0_0:1 layer, lambdas fail with the following errors:

    /opt/node/bin/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /opt/node/bin/node)
    /opt/node/bin/node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /opt/node/bin/node)
    /opt/node/bin/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /opt/node/bin/node)
    

    This is presumably caused by the toolchain changes mentioned in the blog post: https://nodejs.org/en/blog/announcements/v18-release-announce/#toolchain-and-compiler-upgrades

    Full logs
    START RequestId: 7cfca2a1-9f55-43b4-af5c-af4d7339cc20 Version: $LATEST
    /opt/node/bin/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /opt/node/bin/node)
    /opt/node/bin/node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /opt/node/bin/node)
    /opt/node/bin/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /opt/node/bin/node)
    END RequestId: 7cfca2a1-9f55-43b4-af5c-af4d7339cc20
    REPORT RequestId: 7cfca2a1-9f55-43b4-af5c-af4d7339cc20	Duration: 40.55 ms	Billed Duration: 41 ms	Memory Size: 256 MB	Max Memory Used: 4 MB	
    RequestId: 7cfca2a1-9f55-43b4-af5c-af4d7339cc20 Error: Runtime exited with error: exit status 1
    Runtime.ExitError
    
    opened by BeeeQueue 3
  • Serverless

    Serverless

    Hello, how can this project work with Serverless?

    I'd like to deploy a lambda function with this layer using Serverless, but it has a HandlerNotFound error or a ModuleNotFound error on my handler. If I remove runtime: 'provided', the handler is found fine, but the process.env shows version is still 14.

    Any ideas?

    opened by ps-tech 1
  • Docker support

    Docker support

    This is the second time I’ve seen this repo posted, so I thought I’d ask about docker support 😄 There used to be https://github.com/lambci/lambci, but it is no longer maintained

    Docker images can be found on https://hub.docker.com/r/amazon/aws-lambda-nodejs and https://gallery.ecr.aws/lambda/nodejs

    More information on using docker with AWS Lambda can be found:

    • https://docs.aws.amazon.com/lambda/latest/dg/nodejs-image.html
    • https://docs.aws.amazon.com/lambda/latest/dg/images-create.html
    • https://www.serverless.com/blog/container-support-for-lambda

    These resources may also be helpful:

    • https://www.npmjs.com/package/aws-lambda-ric
    • https://docs.docker.com/develop/develop-images/multistage-build/
    opened by jlarmstrongiv 2
  • Documentation on working with other layers

    Documentation on working with other layers

    While attempting to test this repo I encountered a couple of hiccups. First, I wasn't seeing the node version updated when checking inside my Lambda runtime. After some testing I realized that my runtime in my Lambda template was still set to "nodejs14.x" which was overriding any changes the Lambda made. This setting would be useful to highlight in the readMe.

    Second, I'm having issues getting other layers to work when using in conjunction with this repo. For my use case it seems that using a node shebang declaration in my other layer fails. This layer works when using AWS node runtimes so it seems that the layer has changed other parts of the environment outside of node version. This likely just requires some tweaking on my end but it would be helpful to include some documentation on how running an everynode layer differs from the standard AWS node runtime.

    #!/usr/bin/env node
    
    /usr/bin/env: node: No such file or directory
    

    Appreciate the work here. Very interesting feature!

    opened by cjlludwig 3
  • Drawbacks?

    Drawbacks?

    Hey friends!

    This library is super amazing and I am a huge fan of the work being done here. I was just curious if it might be helpful though to write out some of the drawbacks, if there are any, in the readme. For example, since it's using a lambda layer, I assume this means it will cut into the space available per lambda. The normal limit is ~250mb, and node image layers are ~100mb. Additionally, is there a performance penalty incurred when loading node through the layer on a cold boot? Is there anything else I'm missing?

    Not trying to be a downer at all here, I just want to make sure that the tradeoffs are clear for anyone thinking about adopting 😁

    opened by jescalan 2
Owner
Fusebit
With Fusebit, quickly integrate your application to other SaaS applications using flexible API building blocks.
Fusebit
MerLoc is a live AWS Lambda function development and debugging tool. MerLoc allows you to run AWS Lambda functions on your local while they are still part of a flow in the AWS cloud remote.

MerLoc MerLoc is a live AWS Lambda function development and debugging tool. MerLoc allows you to run AWS Lambda functions on your local while they are

Thundra 165 Dec 21, 2022
Hashmat Noorani 4 Mar 21, 2023
AWS Lambda & Serverless - Developer Guide with Hands-on Labs. Develop thousands line of aws lambda functions interact to aws serverless services with real-world hands-on labs

AWS Lambda & Serverless - Developer Guide with Hands-on Labs UDEMY COURSE WITH DISCOUNTED - Step by Step Development of this Repository -> https://www

awsrun 35 Dec 17, 2022
Under the Sea is an official AWS workshop delivered by AWS SAs and AWS Partners to help customers and partners to learn about AIOps with serverless architectures on AWS.

Under the Sea - AIOps with Serverless Workshop Under the Sea is an exciting MMORPG developed by the famous entrepreneur behind Wild Rydes, the most po

AWS Samples 4 Nov 16, 2022
A serverless AWS expense tracker API. AWS Lambda functions, API gateway, and Dynamodb are among the ingredients.

AWS-Serverless-API A serverless AWS expense tracker API. AWS Lambda functions API gateway Dynamodb Endpoints Create a new expense: Method: POST Body f

Ondiek Elijah Ochieng 1 Jul 16, 2022
A monorepo that uses the AWS Cloud Development Kit to deploy and configure nanomdm on AWS lambda.

NanoMDM on AWS This repo builds and configures a nanomdm server to run on AWS lambda. It uses the Cloud Development Kit and tries to follow best pract

Stevie Clifton 4 May 26, 2022
Lumos is an AWS Lambda visualizer and open source alternative to AWS CloudWatch.

Lumos Lambda Metrics Visualizer Table of Contents About Lumos Techologies Used Getting Started Key Lambda Metrics How to Contribute License Contributo

OSLabs Beta 36 Nov 5, 2022
Serverless boilerplate CLI tool: GitLab and GitHub CI/CD, DataDog, Multi-Region, and many more setups.

Serverless Full Boilerplate This is a CLI tool to create Serverless boilerplate applications. Ready to deploy in a few seconds. Usage npm i -g create-

Emin Buğra Saral 9 Nov 7, 2022
📂 Listado de empresas con trabajos tecnológicos dentro de la Región de Murcia.

?? Murcia Tech Hub Listado de empresas con trabajos tecnológicos dentro de la Región de Murcia. Si conoces alguna empresa más o puedes poner algún dat

MurciaDev 9 Jun 30, 2022
The Remix version of the fakebooks app demonstrated on https://remix.run. Check out the CRA version: https://github.com/kentcdodds/fakebooks-cra

Remix Fakebooks App This is a (very) simple implementation of the fakebooks mock app demonstrated on remix.run. There is no database, but there is an

Kent C. Dodds 61 Dec 22, 2022
Implementing hexagonal architecture on AWS Lambda with Node.js

Developing evolutionary architecture with AWS Lambda Context Agility enables you to evolve a workload quickly, adding new features, or introducing new

AWS Samples 95 Dec 20, 2022
Sample code for resizing Images with Lambda@Edge using the Custom Origin. You can deploy using AWS CDK.

Resizing Images with Lambda@Edge using the Custom Origin You can resize the images and convert the image format by query parameters. This Lambda@Edge

AWS Samples 16 Dec 11, 2022
Learn Web 2.0 and Web 3.0 Development using Next.js, Typescript, AWS CDK, AWS Serverless, Ethereum and AWS Aurora Serverless

Learn Web 2.0 Cloud and Web 3.0 Development in Baby Steps In this course repo we will learn Web 2.0 cloud development using the latest state of the ar

Panacloud Multi-Cloud Internet-Scale Modern Global Apps 89 Jan 3, 2023
This web application provides commercial and scientific space travel services. The application allows users to book rockets and join selected space missions.

space-hub About Project "Space Traveler's Hub" is A web application that provides commercial and scientific space travelling services, We are working

Nicholas Emmanuel 7 Nov 2, 2022
In this project we built a web application that consumes an SpaceX API. It provides commercial and scientific space travel services that allows users to book rockets and join selected space missions.

Space Travelers' Hub In this project we built a web application that consumes an SpaceX API. It provides commercial and scientific space travel servic

Diego Yon 7 Sep 30, 2022
This web application provides commercial and scientific space travel services. The application allows users to book rockets and join selected space missions.

Space Traveler's Hub This web application provides commercial and scientific space travel services. The application allows users to book rockets and j

Michael Mesfin 6 Oct 4, 2022