aws-dynamodb-lambda-trigger
Cleans up the code you need to run a DynamoDB trigger on AWS Lambda.
var trigger = // regular lambda fn business hereexports { // register a handler for inserts trigger}
api
trigger.insert(event, context, handler)
register a handler forINSERT
trigger.modify(event, context, handler)
register a handler forMODIFY
trigger.remove(event, context, handler)
register a handler forREMOVE
trigger.all(event, context, handler)
register a handler forINSERT
,MODIFY
andREMOVE
trigger.save(event, context, handler)
register a handler forINSERT
,MODIFY
trigger.change(event, context, handler)
register a handler forINSERT
andREMOVE
In all cases the handler
is a function with the following signature:
{ // do something with record and then callback node-style // if an err is passed to the callback it will be passed to context.fail }
even CLEANER api
var trigger = require('aws-dynamodb-lambda-trigger/lambda')
// runs on every record inserted
function handler(record, callback) {
callback()
}
exports.handler = trigger.insert(handler)