简体   繁体   中英

AWS Lambda destination not triggering with DynamoDB Streams

I'm using AWS Dynamo Streams to trigger an AWS Lambda function. If the lambda function successfully invoked, I want a child lambda function to be invoked via the async invocation destination feature provided by Lambda.

Even though I've configured the async invocation with the target child Lambda function, the child function is not triggered when the parent Lambda function is successful, the child Lambda function's associated CloudWatch log group is empty.

My parent lambda has such policies: AWSLambdaInvocation-DynamoDB (Provides read access to DynamoDB Streams), AWSLambdaFullAccess , AWSLambdaBasicExecutionRole

Question : Why don't onSuccess and onFailure destinations work with invoking parent lambda via AWS Dynamo Streams?

AWS support helped me resolve this issue.

If we configure an async destination for Lambda, the async destination would only work if your Lambda function is invoked asynchronously. So in this specific case, with a DynamoDB event source, DynamoDB does not invoke our function async, but rather Lambda reads from the stream . So there's another option to configure a destination for streams, but that would only be for an on-failure destination.

The async destination would only work with async event sources like SNS or S3.

The page that shows how different event sources works with Lambda

So, if you look under the heading "Services that invoke Lambda functions asynchronously" - those are the service integrations that invoke Lambda async and would work with async destinations. Either those services, or if you actually invoke your function VIA the CLI asynchronously.

So for example if you invoke your function from the CLI and pass the flag --invocation-type Event . That would invoke your function async. If you pass --invocation-type RequestResponse , that would be synchronous.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM