Reputation: 61
How can we trigger aws lambda only when the folder is uploaded having prefix configurations set as another folder.
for eg. we have images/ folder inside bucket. And now we want to trigger when a date folder i.e. 20181128 is uploaded to images folder, having images inside in it.
individual images shouldn't trigger lambda, rather only uploaded folder should trigger.
What s3 trigger configuration should be set in this condition?
I have gone through lot of scenarios and individual images is triggering lambda, which I don't want. I want it should trigger only when a folder is uploaded.
Upvotes: 4
Views: 6775
Reputation: 76
Tried to enable Object creation classification.
Multipart upload completed
s3:ObjectCreated:CompleteMultipartUpload
Hope it helping you!
Upvotes: 0
Reputation: 177
How I solved this issue: with Suffixes you can define "/" as desired pattern. So if you upload for example "haha/" folder, Lambda should be triggered. Just tested that and it works.
Upvotes: 2
Reputation: 178964
This is not possible. S3 does not consider the objects to actually be "inside" a folder.
Review How do I Use Folders in an S3 Bucket for clarification on S3's folder logic.
Upvotes: 2