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.

asked 7 months ago223 views
3 Answers
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
EXPERT
answered 7 months ago
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
EXPERT
Uri
answered 7 months ago
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
EXPERT
answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions