alexkrkn / lambda-build

Bundle, archive and upload your lambda functions
MIT License
25 stars 4 forks source link

lambda action

How it works

Install

npm i --save-dev lambda-build
npm i --g lambda-build
npx lambda-build --help

CLI Usage

npx lambda-build

lambda-build archive

npx lambda-build archive bundles your code and creates a local archive.zip file that you can then upload to aws yourself.

lambda-build upload

npx lambda-build upload bundles your code and then uploads it directly to your AWS lambda functions (requires the aws cli to be locally configured).

Library Usage

build()

import { build } from 'lambda-build';

const res = await build({
  entry: 'src/index.js',
  external: ['lodash', 'dayjs'],
  metafile: true,
});

buildAndUpload()

import { buildAndUpload } from 'lambda-build';

const res = await buildAndUpload({
  entry: 'src/index.js',
  external: ['lodash', 'dayjs'],
  metafile: true,
  lambdas: ['my-lambda1', 'my-lambda2'],
  region: 'us-east-2',
});

Screencast

lambda-build screencast

More Lambda Screencasts

Follow me for updates