schedule-aws-lambda

0.0.1 • Public • Published

schedule-aws-lambda

attach a schedule to an existing aws lambda function

npm status

example

npm i schedule-aws-lambda

const { Lambda, CloudWatchEvents } = require('aws-sdk')
const lambda = new Lambda()
const cloudwatch = new CloudWatchEvents()
const schedule = require('schedule-aws-lambda')(lambda, cloudwatch)

schedule('the-function-name').withInput({ foo: 'bar' }).at('rate(5 minutes)').then(console.log)

api

This module exposes the following fluent interface:

require('schedule-aws-lambda')(dependencies)(functionName)
    .[withInput(...) | input(...) | rule.id(...) | rule.name(...) | rule.description(...) ]
    .at(expression)
    .then(...)

input() is an alias of withInput()

alternatively one can use the execute api:

require('schedule-aws-lambda')(dependencies)
    .execute({ functionName, functionInput }, { ruleName, ruleDescription, ruleId = ulid(), scheduleExpression })
    .then(...)

for further details examine the source and jsdocs

license

MIT © Yaniv Kessler

Readme

Keywords

Package Sidebar

Install

npm i schedule-aws-lambda

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • kessler