After giving all the rights to invoke function. My Lambda function is not able to invoke another function . Every time I am getting timeout having 30 seconds timeout
issue. It looks like lambda is not able to get another lambda function
My lambdas are in same region, same policy, same security group .. Also VPC are same in both lambdas. The only thing is different now is lambda functions
Here are the role rights
1) created AWSLambdaExecute
and AWSLambdaBasicExecutionRole
2) Created one lambda function which is to be called
Lambda_TEST
exports.handler = function(event, context) {
console.log('Lambda TEST Received event:', JSON.stringify(event, null, 2));
context.succeed(event);
};
3) Here is a another function from where it is called .
var AWS = require('aws-sdk');
AWS.config.region = 'us-east-1';
var lambda = new AWS.Lambda();
exports.handler = function(event, context) {
var params = {
FunctionName: 'Lambda_TEST', // the lambda function we are going to invoke
InvocationType: 'RequestResponse',
LogType: 'Tail',
Payload: '{ "name" : "Arpit" }'
};
lambda.invoke(params, function(err, data) {
if (err) {
context.fail(err);
} else {
context.succeed('Lambda_TEST said '+ data.Payload);
}
})
};
Reference taken from : This link
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…