Reputation: 41
I have a requirement where my lambda processes files from 2 s3 locations, I don't know when the file will land. But I want to trigger lambda only when I receive s3:PutObject from both the locations.
Is it possible to define a event rule, which can monitor or wait for files to be put in both s3 locations and then only forward it to target?
Yes I know, there are many different ways to solve this. This is not the exact problem statement but I just created a basic use-case related to my requirement.
So, Kindly advise me if its possible through Aws EventBridge or not, if yes , how can I configure it.
Thanks.
I went through event bridge documentation and couldn't find anything similar to my requirement.
Upvotes: 1
Views: 1287
Reputation: 2018
The answer to your question, is there an event rule and can you use EB; is no you cannot. You need to manually implement some intermediary to cache whichever lands first, and artificially create a single EB event when the second S3 object lands. The simplest is probably S3 => DDB and use whatever key is common between them to be the DDB Item Id, putting the s3 event on an item key. Then route a DDB Stream => Event Bridge, so you will get the event containing both files' metadata.
Upvotes: 1