简体   繁体   中英

S3 event notification not raising an event when specifying a prefix

I have been working on a requirement where I need to add a message to SQS queue or invoke a lambda when a specific file is return to my processing folder in S3 bucket. I have a folder structure like dev/runs/runid11/result/process1/process_result.csv in a bucket called "test-bucket". There is a dynamic folder here - the runid folder. For every run a separate runid folder will be created with a similar structure inside. I need to add a message to SQS when process_result.csv is written to the bucket. To make it more specific, I am creating the event notification with a prefix of process1/. The suffix is *.csv. No event is getting generated if I have the prefix specified. I tried with several combinations however with no success. Need to ask here if I am supposed to give the entire path from dev/runs/runid11/result/process1/? That won't work for me as the runid folder is dynamically created. I would like to make the prefix work as several files are written to runid11 folder. Some of them can be csv as well. Currently I managed by making my suffix more specific like _result.csv. However with prefix I can be even more sure that an event is raised only for the required file. Any help appreciated.

A similar question has been asked S3 Event Prefix for Subfolders . However I still couldnt figure why mine isn't working.

Try to give a prefix up to the directory where it is not dynamically created for. Eg give it as dev/runs/ , since the remaining directories are going to get dynamically created as runid11/result/process1/process_result.csv via some job.

Make sure that the directory dev/runs/ is already created and in place.

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