0

I have SQS -> triggers a lambda(code that needs to be tested) -> where its workflow -> can trigger other lambdas in multiple API Gateways (already deployed in AWS)

Is there a way I can emulate SQS locally so that I can test the lambda locally while also calling other lambdas that are deployed in AWS?

We already are using serverless-offline, which allows us to test a lambda locally. What we are looking for to test is the following scenario SQS(local)-> lambda (local) -> lambda (on aws account)

the lambda makes calls to other lambda's like this. how can we emulate those locally?

params = {
                FunctionName: lambdaName,
                InvocationType: 'RequestResponse',
                LogType: 'None',
                Payload: JSON.stringify(event)
            };
        }
        response = await lambda.invoke(params).promise();

Thanks

1 Answer 1

0

You can use LocalStack. Here you can find a tutorial on how to do that. https://rochisha-jaiswal70.medium.com/using-aws-lambda-with-amazon-simple-queue-service-bb0694257a2b

Sign up to request clarification or add additional context in comments.

2 Comments

updated the question. can you tell me how we can do the lambda (local) -> lambda (on aws account) or alternatively lambda (local) -> lambda (different lambda locally)
It's not a good practice to call a Lambda directly from another one. You can use Step Functions instead. You can also place an API Gateway in front (in the case you have several Lambdas that can be logically grouped).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.