1

I understand how to use S3 put request to trigger a lambda function when a new object is created in S3.

However, I want to trigger a different lambda function when I am updating a S3 object (overwriting the original object with the same key). It doesn't seem like there is a method provided to me to distinguish between create and update when choosing the trigger. How can I accomplish this goal?

1 Answer 1

2

Unfortunately you can't, just from the S3 event body. An update is also a PUT operation that is indistinguishable from a create PUT operation.

In theory, you could store all events and when there is a second PUT event for the same key, you know it is an update; this isn't trivial or cheap to do.

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

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.