How to trigger Target lambda(Lambda2) based on Source Lambda(Lambda1) status only if Lambda1 is successful(Cannot modify Lambda1)

0

HI, How can i trigger target lambda(Lambda2) based on source lambda(Lambda1) success.I cannot modify Lambda1 so i need to get the status of Lambda1 and trigger Lambda2 only if Lambda1 is successful,Source Lambda runs monthly once at specific time. Can you please suggest option to achieve this(like event bridge). We have 2 lambda's(Lambda1 and Lambda2) which resides in same AWS account.

已提問 8 個月前檢視次數 244 次
3 個答案
0

Hello.

Even without using EventBridge, it is possible to set up notifications to SNS when Lambda is successful, so how about running subsequent Lambdas via SNS?
https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations

profile picture
專家
已回答 8 個月前
0

Lambda functions support Lambda Destinations, which is used exactly for this use case. You can configure and onFailure target and an onSuccess target. The target can be SQS, SNS, EventBridge or a different Lambda functions.

Note that Lambda Destinations is only available for asynchronous invocations. As you said your function runs on a schedule, I assume it is an async invocation so it should work for you.

profile pictureAWS
專家
Uri
已回答 8 個月前
0
  1. as mentioned above, leverage lambda estimation
  2. use component in middle for asynchronous flow, such as SQS,SNS,Eventbridge 3)For synchronous flow you can useInvoke api from Lambda1 to 2, though this highly couples the fictions. https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html
profile picture
專家
已回答 6 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南