-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
We are in process writing an integration test for lambda.
Here is the situation LambdaA calls LambdaB internally.
Now I am invoking sam lambda A which internally call lmbdaB... ON AWS console this is working but not able to work it from SAM local.
However, if lambaB invocation is removed from LambdaA, both lambda works fine in SAM LOCAL.
Is this supported by SAM local, any workaround to move forward?
code snippets
var AWS = require('aws-sdk');
AWS.config.region = 'eu-west-1';
var lambda = new AWS.Lambda();
exports.handler = function(event, context,callback) {
var params = {
FunctionName: 'lambda-B', // the lambda function we are going to invoke
InvocationType: 'RequestResponse',
LogType: 'Tail',
Payload: JSON.stringify(event,null,null)
};
lambda.invoke(params, function(err, data) {
const dataPayload=data.Payload;
console.log("------dataPayload-----"+dataPayload);
console.log("------Now it should work-----"+JSON.parse(dataPayload).errorType);
if (err) { context.fail(err);
} else {
context.succeed('Lambda_SIGNATURE said '+ JSON.stringify(data));
}