Created
May 12, 2017 20:01
-
-
Save ataube/206f1b5292e04dd7c2c9acd8382a96a6 to your computer and use it in GitHub Desktop.
Lambda exec example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk'); | |
const lambda = new AWS.Lambda({ region: 'eu-central-1', endpoint: 'http://localhost:3050' }); | |
const params = { | |
FunctionName: 'hello-world', | |
InvocationType: 'RequestResponse', | |
Payload: JSON.stringify({ | |
queryStringParameters: {}, | |
headers: {}, | |
}), | |
Qualifier: '$LATEST', | |
}; | |
lambda.invoke(params, (err, data) => { | |
if (err) { | |
console.log('Error', err); | |
return; | |
} | |
console.log(data.Payload); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment