Lambda destination for other Lambda is not invoked

0

Hello,

In the diagram below the Lambda Function L2 is a successful asynchronous destination for Lambda Function L1.
Enter image description here

When the event comes from SQS, L2 is not invoked.
When the event comes from S3, L2 is invoked.
When event comes from Actor that test in Lambda screens from Management Console, L2 is not invoked.
When L1 is invoked from L3 using asynchronous invocation, L2 is not invoked.

 private AWSLambdaAsync lambda = null;
    
    public LambdaFunctionHandler() {
    	lambda = AWSLambdaAsyncClientBuilder.standard()
    			.withRegion(Regions.US_EAST_2)
    			.build();
    }
Future<InvokeResult> future_res = lambda.invokeAsync(req);

Could you please explain the above behaviours ? Is the L2 invocation related to how the event is sent to L1 (synchronous/ asynchronous) ?

Could you please specify how to send SQS events so that L2 to be invoked ?

Thank you,
Mihai ADAM

1 個回答
2
已接受的答案

Hi,

you are seeing this behavior because the Lambda function L2 is configured as a successful asynchronous destination. That means, it is only invoked when the initial invoke was a async request. So, in your case,

Basically, the destination is only invoked for asynchronous requests.

To add some context: The primary use case of Destinations is to know about the async execution results of Lambda functions, primarily to get more visibility into the execution details like request and response contexts, payloads, exception stack traces and so on.

profile pictureAWS
專家
已回答 2 個月前
profile picture
專家
已審閱 2 個月前
profile picture
專家
已審閱 2 個月前
profile picture
專家
已審閱 2 個月前
profile picture
專家
已審閱 2 個月前
  • Thanks a lot, it worked, L2 was invoked after I changed the InvocationType to Event in L3

  • The described L2 behaviour applies also to an SNS. The SNS destination is used only if the L1 request is asynchronous.

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

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

回答問題指南