I have two AWS lambda functions which are processing all images uploaded to an S3 bucket(One is for creating thumbnail and another is for image moderation[rekognition]).
While I am doing it, I found it invalid to add event notifications with overlapping prefix and suffix.
For example, let's assume that I want to set the two event notification like the below.
event type: PUT | prefix: root | suffix: .jpg | send to: lambda-A
event type: PUT | prefix: root | suffix: .jpg | send to: lambda-B
# Error message: Cannot have overlapping suffixes in two rules if the prefixes are overlapping for the same event type.
If it is not available I think there must be a kind of pattern commonly used in this case(for instance, making a proxy lambda to call the two lambdas passing the same event notification.)
What is the best way to handle the case?
AWS wrote an article entitled Fanout S3 Event Notifications to Multiple Endpoints. Options include:
The article was written before Step Functions, so if the processing required is moderately complex then you might also consider triggering Step Functions to drive multiple coordinated Lambda functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With