aws-lambda-helper
Collection of helper methods for lambda
Installation
$ npm install aws-lambda-helper --save
Usage
var AwsHelper = require('aws-lambda-helper');
exports.handler = function(event, context) {
...
var awsHelper = AwsHelper(context);
...
}
Invoke a Lamda function
var AwsHelper = require('aws-lambda-helper');
var AWS = require('aws-sdk');
exports.handler = function(event, context){
var awsHelper = AwsHelper(context);
console.log(awsHelper.env);
console.log(awsHelper.region);
console.log(awsHelper.region);
var params = {
FunctionName: 'MyAmazingLambda',
Payload: { 'hello': 'world' },
Qualifier: ''
};
awsHelper.Lambda.invoke(params, function (err, data) {
if(err) return context.fail(err);
context.succeed(data);
});
}
Invoke a Lamda function