3 Antworten
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
1
Hey @pbouwdewijn,
I found a way to do it in one easy rule.
There is a wildcard
filter option, so you can write something like this and it will work exactly as you want.
{ "source": ["aws.s3"], "detail-type": ["Object Created"], "detail": { "bucket": { "name": ["some-bucket"] }, "object": { "key": [{ "wildcard": "some-prefix/*.extension" }] } } }
beantwortet vor 6 Monaten
0
I am also encountering this issue and some things I found out:
- If you include multiple values in brackets, it's treated as an OR condition
- If you include a key more than once, the last reference will be the one used to evaluate events
- Therefore for the following event pattern, only
{ "suffix": ".extension" }
will be taken into account when evaluating thekey
.
"object": { "key": [{"prefix": "some-prefix/"}], "key": [{"suffix": ".extension"}] }
- Therefore for the following event pattern, only
So far, the following are the workarounds I can think of for my use case:
- Use the regular S3 Event notification feature as it can limit based on prefix AND suffix - whenever I only need to publish the event to Lambda, SQS or SNS
- If I really need to publish to EventBridge, I will create an S3 replication to another bucket and limit the scope to a prefix. That second bucket has EventBridge notification enabled and the event pattern filters the suffix
beantwortet vor einem Jahr
0
I also encountered this issue, I was able to solve it by creating another Eventbus. My first event comes from s3 to the default EventBus and is filtered by prefix. I then trigger an event on a second Eventbus that filters by suffix, that targets my lambda
beantwortet vor einem Jahr
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 3 Jahren