https://github.com/kessler/schedule-aws-lambda
attach a schedule to an existing aws lambda function
https://github.com/kessler/schedule-aws-lambda
aws aws-lambda node-module nodejs npm-module npm-package
Last synced: 5 months ago
JSON representation
attach a schedule to an existing aws lambda function
- Host: GitHub
- URL: https://github.com/kessler/schedule-aws-lambda
- Owner: kessler
- License: mit
- Created: 2017-12-16T16:43:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-16T16:46:22.000Z (about 8 years ago)
- Last Synced: 2025-08-13T04:43:33.330Z (5 months ago)
- Topics: aws, aws-lambda, node-module, nodejs, npm-module, npm-package
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# schedule-aws-lambda
**attach a schedule to an existing aws lambda function**
[](https://www.npmjs.org/package/schedule-aws-lambda)
## example
`npm i schedule-aws-lambda`
```js
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:
```js
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:
```js
require('schedule-aws-lambda')(dependencies)
.execute({ functionName, functionInput }, { ruleName, ruleDescription, ruleId = ulid(), scheduleExpression })
.then(...)
```
for further details examine the source and jsdocs
## license
[MIT](http://opensource.org/licenses/MIT) © Yaniv Kessler