Skip to content

Instantly share code, notes, and snippets.

@SeptiyanAndika
Created August 6, 2018 07:33
Show Gist options
  • Save SeptiyanAndika/2699736f8615211f46e5e47203462f81 to your computer and use it in GitHub Desktop.
Save SeptiyanAndika/2699736f8615211f46e5e47203462f81 to your computer and use it in GitHub Desktop.
const AWS = require('aws-sdk');
var params = {
IdentityPoolId: "ap-southeast-1:xxxx"
};
AWS.config.region = 'ap-southeast-1';
AWS.config.credentials = new AWS.CognitoIdentityCredentials(params);
var lambda = new AWS.Lambda();
lambda.invoke({
FunctionName: 'client-lambda-dev-public', // your function name
Payload: JSON.stringify({}) // how you send the email to the Lambda event
}, function(err, data){
if (err) {
console.log(err, err.stack);
} else {
console.log(data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment