Can we do write-object-if-not-exist in S3 similar to conditional put in Dynamo DB?

1

I have a use case, where I need to avoid overriding the objects. I do understand that because of the distributed nature of the S3, it might not available. Are there any tricks and hacky way to achieve not to override the object in S3 ?

Dynamo DB is also distributed, but it provides conditional put. Wondering what is the architectural difference between Dynamo DB and S3 ?

asked 2 years ago3911 views
2 Answers
0

S3 Natively does not have any conditions that would satisfy this for the PutObject but what you could consider is making a HeadObject request first and if the object does not exist (404 - requires the writer to have s3:ListBucket permission) then continue with the PutObject.

AWS
SUPPORT ENGINEER
Suran_N
answered 2 years ago
0
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions