简体   繁体   English

AWS EventBridge:1 个目标的多个源事件

[英]AWS EventBridge : multiple source events for 1 Target

I have a requirement where my lambda processes files from 2 s3 locations, I don't know when the file will land.我有一个要求,我的 lambda 处理来自 2 个 s3 位置的文件,我不知道文件何时到达。 But I want to trigger lambda only when I receive s3:PutObject from both the locations.但我只想在从两个位置收到 s3:PutObject 时触发 lambda。

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?是否可以定义一个事件规则,它可以监视或等待将文件放在两个 s3 位置,然后仅将其转发到目标?

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.所以,请告诉我是否可以通过 Aws EventBridge 进行操作,如果可以,我该如何配置它。

Thanks.谢谢。

I went through event bridge documentation and couldn't find anything similar to my requirement.我浏览了事件桥文档,但找不到与我的要求类似的内容。

The answer to your question, is there an event rule and can you use EB;你问题的答案,有没有事件规则,能不能用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.您需要手动实施一些中介来缓存先着陆的那个,并在第二个 S3 object 着陆时人为创建单个 EB 事件。 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.最简单的可能是 S3 => DDB 并使用它们之间的任何公共键作为 DDB 项目 ID,将 s3 事件放在项目键上。 Then route a DDB Stream => Event Bridge, so you will get the event containing both files' metadata.然后路由 DDB Stream => Event Bridge,这样您将获得包含两个文件元数据的事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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