Search code examples
amazon-web-servicesamazon-s3conditional-statements

Amazon S3 conditional put object


I have a system in which I get a lot of messages. Each message has a unique ID, but it can also receives updates during its lifetime. As the time between the message sending and handling can be very long (weeks), they are stored in S3. For each message only the last version is needed. My problem is that occasionally two messages of the same id arrive together, but they have two versions (older and newer).

Is there a way for S3 to have a conditional PutObject request where I can declare "put this object unless I have a newer version in S3"?


Solution

  • Conditional writes are, as of August 2024, supported by S3: https://aws.amazon.com/about-aws/whats-new/2024/08/amazon-s3-conditional-writes/