S3 Prefix Regex


I'm planning to use s3 bucket with dynamic prefix name using cognito user id like this :


under the prefix I have 2 folder

  1. Labels
  2. Submissions

I'm trying to configure S3 Event to only trigger Lambda every time a file stored in the Submissions. I don't want file uploaded to Labels triggers the Lambda.

My understanding S3 event prefix doesn't support the regex / wildcard.

Want to confirm that & also looking for the alternative solution to implement such requirement?

asked 4 years ago2904 views
1 Answer
Accepted Answer

If you can control the process of appending a pseudo/unconventional extension to the file before being stored in /Submission then you can raise a trigger on that particular suffix instead of the prefix. Your Lambda can rename the file (omit the pseudo extension) and execute the rest of the function logic.

This is a simple alternative until wildcard support for prefixes materializes

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions