aws / aws/aws-sam-cli

Support one Local Lambda calling another Local Lambda scenarios

Open
#510 25 comments 18 reactions 0 assignees View on GitHub
area/docs area/local/invoke maintainer/need-followup priority/2-important type/feature
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

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));
}

Contributor guide

Open the contributing guide

Research direction

No repository files or tests are named. Start by reproducing the SAM local invocation where LambdaA calls LambdaB, using the provided AWS SDK snippet and comparing it with the working AWS console behavior. Done means establishing whether nested local invocation is supported and documenting a confirmed workaround or limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
cli, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.