Search code examples
amazon-web-servicescloud-storage

"If-Match" or "x-goog-if-generation-match" equivalent for PUT requests with AWS/S3


Is there an equivalent to the "If-Match" (Azure) or "x-goog-if-generation-match" (Google Storage) equivalent for PUT requests sent to Amazon S3 blob storage?

Both these headers do the same thing - they allow you to specify that a PUT request to overwrite an object should only succeed if you are overwriting a specific previous version of the object. Details:

https://learn.microsoft.com/en-us/azure/storage/common/storage-concurrency?toc=/azure/storage/blobs/toc.json#optimistic-concurrency-for-blobs-and-containers

https://cloud.google.com/storage/docs/xml-api/reference-headers#xgoogifgenerationmatch

Thanks!


Solution

  • Unfortunately, S3 doesn't support conditional PUT. You need to cooperate with other AWS services, such as DynamoDB, to achieve such behaviour.