I have 2 aws lambda functions i.e. "LambdaChain1" and "LambdaChain2" i am calling aws lambda function "LambdaChain2" from aws lambda function "LambdaChain1" as follows :
enter code here var start=new Date();
enter code hereconsole.log('Loading function');
exports.handler = function(event, context) {
//console.log('Received event:', JSON.stringify(event, null, 2));
event.Records.forEach(function(record) {
// Kinesis data is base64 encoded so decode here
var payload = new Buffer(record.kinesis.data, 'base64').toString('ascii');
console.log('Decoded payload:', payload);
});
context.succeed("Successfully processed " + event.Records.length + " records.");
var params = {
FunctionName: 'LambdaChain2', /* required */
InvokeArgs: start.getTime() /* required */
};
lambda.invokeAsync(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
};
Now we can see from the code that I have passed "start.getTime()" as parameter to aws lambda function "LambdaChain2"....
I want to know that in aws lambda function LambdaChain2 how can I retrieve or use the parameter that I have passed to the function "LambdaChain2" from lambda function "LambdaChain1".....Can you please provide an example