I have a lambda function that I need to run eveytime there is a change in my s3 Bucket. I have added the trigger and it is working just fine, but I was wondering if there is any way to limit the scope the lambda function is to be run... for example Instead of running over the entire bucket, it runs only in the folder (inside the bucket) that change has been made?! or something like that..!
Asked
Active
Viewed 478 times
2 Answers
3
You can specify rules:
- s3:
bucket: photos
event: s3:ObjectCreated:*
rules:
- prefix: uploads/
- suffix: .jpg
See the functions/events/s3
section in the yml definition.

cy3er
- 1,699
- 11
- 14
1
Per this AWS announcement, you can add prefix or suffix restrictions for S3 event triggers.

Mark B
- 183,023
- 24
- 297
- 295