Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EventBridge notification on Amazon s3 folder

I have to start stepMachine execution upon file upload on a folder inside bucket, I got to know how we can configure eventbridge on S3 bucket level. But on the same bucket there can be multiple file uploads. I need to get notified when object inserted into a particular folder inside bucket. Is there any possible way to achieve this?

like image 809
kafka services Avatar asked Feb 19 '26 19:02

kafka services


1 Answers

Here is another solution. Since folders technically do not exist in S3 and merely a UI feature, "folders" in S3 are ultimately called prefixes.

You can trigger an EventBridge Notification on an S3 folder with the following event pattern:

{
  "source": ["aws.s3"],
  "detail-type": ["Object Created"],
  "detail": {
    "bucket": {
      "name": ["<bucket-name>"]
    },
    "object": {
      "key": [{
        "prefix": "<prefix/folder-name>"
      }]
    }
  }
}
like image 73
its.david Avatar answered Feb 23 '26 21:02

its.david



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!