@anabode/scheduler_cw
v0.0.1
Published
Scheduler ===
Downloads
3
Readme
Scheduler
Inserts a scheduled rule and assigns a target invocation.
Currently supports Lambda and SNS.
Prerequisites:
JSON credentials file and config object with at least {aws: {region = 'eu-west-1, topicArn: ''}}'
Usage:
npm i @anabode/scheduler_cw --save
var payload = {
"Name": "name-me",
"Description": "fooo",
"detail": {"Body": "stuff happens", "Title": "AppTest", "Stuff": "more IDS and relevenat identifiers go here"},
"type_name": "reminder",
"type_id": "31cb0ab9-c53f-4f4e-83e3-38291793d1b5",
"cron_expr": "19,20,22 16 11 OCT ? 2018"
};
var conf = { aws: { region: 'eu-west-1', targetArn: 'arn:aws:sns:eu-west-1:1234556789012:some-topic' }};
var schedulerWorker = require('@anabode/scheduler_cw');
schedulerWorker.createScheduledRule(payload, conf, (e, d) => {
if (e) {
console.error(e.message, e.stack);
} else {
console.log(d)
}
})