简体   繁体   中英

Is it possible to trigger a specific lambda function from the AWS Kinesis stream?

Is it possible to trigger a specific lambda function from the AWS Kinesis stream?

I have multiple lambda functions (CREATE/UPDATE/DELETE) which are subscribed to the kinesis stream, now I want to trigger only specific lambda function based on the data/event type.

Is it possible? If not what is the better architecture/way to handle this problem?

Sadly, you can't do this. There are generally two ways to overcome this:

  1. Connect your stream to one lambda function. The function will receive all records from the stream and dispatch them to other functions . The dispatch can be direct, or through dedicated SQS queues for example.
                   /-----> SQS 1 ---> CREATE lambda
Kinesis---->Lambda ------> SQS 2 ---> UPDATE lambda
                   \-----> SQS 3 ---> DELETE lambda
  1. Also use one function, but this time UPDATE, CREATE and DELETE code will be in the single function. So in the lambda handler function, you would use basic if-then-else conditions to invoke different code for UPDATE, CREATE and DELETE functionality.

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