AWS API: How to write code that checks whether a file exists in a specific bucket?
The best method to check if an object exists is to call the headObject function. This is what the
waitFor('objectExists', ...) method uses behind the scenes to check if an object exists.
You want the Head operation:
The HEAD operation retrieves metadata from an object without returning the object itself.
This is the closest thing to a 'contains' operation that fetches the minimum possible for determining object existence.