Skip to content

Instantly share code, notes, and snippets.

@morishin
Created March 19, 2017 05:21
Show Gist options
  • Save morishin/aa128e05985bc1ad01dd1b37051e555b to your computer and use it in GitHub Desktop.
Save morishin/aa128e05985bc1ad01dd1b37051e555b to your computer and use it in GitHub Desktop.
Call Lambda function from Lambda function
exports.handler = function(event, context, callback) {
var aws = require('aws-sdk');
var lambda = new aws.Lambda();
lambda.invoke({
FunctionName: 'your-lambda-function-name',
Payload: JSON.stringify(event)
}, function(error, data) {
if (error) {
context.done('error', error);
}
if(data.Payload){
context.succeed('done')
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment