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달 전240회 조회
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
전문가
답변함 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠