0

I am using Cloudwatch events to trigger Lambda Function.I have almost 60 lambda function . Each lambda function have 12 to 13 Cloudwatch events. MIS_ACTION and CUSTOMER_ID in JSON format are different for each lambda. I want to optimize cloudwatch events.

How can I call multiple lambda using single lambda by passing dynamic JSON on each lambda function?

I am using below JSON to pass in Cloudwatch Rules as:

{
   "Records":[
      {
         "body":"",
         "messageAttributes":{
            "MIS_ACTION":{
               "dataType":"String",
               "stringValue":"CONSOLIDATEDALERT"
            },
            "CUSTOMER_ID":{
               "dataType":"String",
               "stringValue":"31"
            }
         }
      }
   ]
}
1
  • anytime i hear lambda orchestrating other lambda functions, I automatically think "step functions" Commented Sep 25, 2019 at 14:19

1 Answer 1

1

Have the lambdas listen to the same topic on SNS. Then have the initial lambda message that SNS topic with the JSON they require. That should allow you to trigger them all from a single lambda. If each follow-up lambda needs customized JSON to run successfully you might need a SNS topic for each follow-up lambda with the customized JSON as the trigger message.

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

Comments

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.