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.

posta 7 mesi fa232 visualizzazioni
3 Risposte
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
ESPERTO
con risposta 7 mesi fa
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
ESPERTO
Uri
con risposta 7 mesi fa
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
ESPERTO
con risposta 5 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande