AWS - SQS Scheduler
A tiny helper to manage scheduled lambda function and sqs + lambda using BBC`s sqs-consumer.
Installation
npm install aws-sqs-schedule
Usage
sqs_scheculer.init(opt)
Launch the scheduler and sqs queue consumers.
-
opt (Object) options.
-
opt.aws (Object) aws region, accessKeyId and secretAccessKey.
-
opt.consumers[] (Array) List of consumers.
- id (String) internal identifier to be used in logs
- queueUrl (String) sqs url
- batchSize (Number) size batch max = 10
- functionName (String) aws lambda function name
- waitTimeSeconds (String) time to wait
-
opt.schedules[] (Array) List of event`s schedules.
- id (String) internal idetifier to be used in logs
- cron (String) cron, ex: */2 * * * 1-5,
- functionName (String) event name,
- Payload (String) lambda event payload
-
opt.cb (Function) function thats is called in every aws lambda invoke, with {id, FunctionName, InvocationType, Payload}
example:
var sqs_scheculer = ; sqs_scheculer;
Debug mode
DEBUG=info,error node index
```
------
Very useful [cron helper ](http://crontab.guru/)