简体   繁体   中英

Using wildcard in Custom event pattern for the S3 event

I want to send an SQS notification from an S3 bucket on a specific folder but seems wildcards are not supported in EventBridge as well as S3 Event Notification. Is there any way by which I can trigger my SQS. BucketName: my-s3-bucket want to send notification if file added in a specific folder inside this bucket:

MyFolder/<username>/INPUT/abc.txt

and not on any other folder inside this bucket. I tried EventBridge as well by below event but no luck there as well:

 {
  "source": ["aws.s3"],
  "detail-type": ["Object Created"],
  "detail": {
    "bucket": {
      "name": ["my-s3-bucket"]
    },
    "object":{
      "key":[{"prefix":"*/INPUT/*"}]
    }
  }
}

Please suggest

If its not directly supported then you have to filter your events through a lambda function :

S3 ---> Lambda to filter the enents ----> SQS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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