1

Let's say I upload folder/key.jpg to a S3 bucket. How would I trigger a lambda function only when a file contains jpg at the end of File Name, is uploaded?

Is this possible or do I need to check the filename in the function and early-out it doesn't match what I'm looking for?

The reason I ask is that a lot of stuff will be uploaded to the bucket, and it seems inefficient (and costly) for the function to trigger every time.

3 Answers 3

2

It is possible to trigger lambda only on jpg image is uploaded in your s3 folder, follow https://n2ws.com/blog/aws-automation/lambda-function-s3-event-triggers. Just add jpg as suffix and foldername as prefix in event section of s3.

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

Comments

1

You can use S3 Event notifications.

For example:

enter image description here

Comments

0

You could use Suffix filter. As per this blog

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.