Support one Local Lambda calling another Local Lambda scenarios
- 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
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