0

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..!

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

Per this AWS announcement, you can add prefix or suffix restrictions for S3 event triggers.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.