0
votes

I have a Scheduled Lambda function (via CloudWatch event rule) which is triggered every minute.

This lambda picks up a request from SQS queue, process the parameters and triggers AWS step functions workflow.

Now, ONLY 1 Lambda function instance is running every minute. How can I trigger multiple (e.g. 10) concurrent Lambda functions like this?

One way I can think of is to create 10 Cloudwatch event rule which runs every 1 minute, but I am not sure if that is the right way of doing it. Also, if I use this way, 10 lambda would be called even if I don't have entries in my SQS queue.

2
You can process multiple SQS messages in a single Lambda execution. If you want to be reactive and execute a Lambda for each SQS message, you may configure SQS to publish an SNS event/message, and configure a trigger on the SNS topic to execute the Lambda everytume a new event/message is published.jweyrich

2 Answers

0
votes

You can use the lambda step function.

Event trigger first function. Then it will call multiple functions parallel.

Some useful links:

https://www.youtube.com/watch?v=c797gM0f_Pc

https://medium.com/soluto-nashville/simplifying-workflows-with-aws-step-functions-57d5fad41e59

0
votes

since your lambda function fetching data from SQS so you can create event source mapping between lambda and SQS so whenever message published to SQS, your lambda function will invoke concurrently depending on number of messages in queue so you do not need to invoke lamnda from cloudwatch event