aws-lambda-helper
Collection of helper methods for lambda
Installation
$ npm install aws-lambda-helper --save
Usage
var AwsHelper = require('aws-lambda-helper');
var AWS = require('aws-sdk');
var awsHelper = AwsHelper(AWS, context);
Invoke a Lamda function
var AwsHelper = require('aws-lambda-helper');
var AWS = require('aws-sdk');
exports.handler = function(event, context){
var awsHelper = AwsHelper(AWS, 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);
});
}
``