A bun runtime for AWS Lambda, create fast lambdas using bun runtime for javascript. An example lambda handler...
export async handler(event, context) {
let output = "Hello world from bun runtime";
return {
"body" : output,
"statuscode" : 200
}
}
- Download the release
- create a lambda layer with runtime as
custom on amazon linux 2
and architecture asx86_64
and upload the zip - attach the layer to a lambda created with custom runtime and upload your code
- run the lambda and enjoy using bun on lambda
- linux, duh
- pipenv is used to install packages and manage virtual env for tests
- yarn is the package manager for the test lambda code written in javascript in the test_src dir
- docker is used to create the test lambda using the environment (sudo might be required depending on the docker installation, makefile has sudo by default where required but remove sudo if your installation does not need sudo to run docker)
- Clone the repository and cd into the directory
git clone <git_url> && cd bun-lambda
- run make to build when you have all the requirements are met
make
- find the lambda layer package zip for the runtime inside the
package
folder