Home > Back-end >  How to set up directory level triggers in AWS S3 for Lambda?
How to set up directory level triggers in AWS S3 for Lambda?

Time:11-11

I have a directory structure as shown below

S3 Bucket
 -logs/
  -product1_log.txt
  -product2_log.txt
 -images/
 -products/

There are a couple of directories mentioned above in the S3 bucket, now whenever a new file gets added to the logs folder, I have a lambda function that updates the timestamp in my MongoDB.

Requirement

  • Trigger lambda function only when logs folder gets updated, update to other folders should not trigger the lambda

CodePudding user response:

Exact same use case described in the below link.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html

  • Related