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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则