Leonardo Savio

I'm Leonardo Savio, a Cloud Architect from Brazil, passionate about AI, backend development, and solving complex problems through innovative solutions. I've been working as a developer since 2010, constantly evolving with the latest technologies.

Blog

AWS S3 conditional writes

Amazon S3 now supports conditional writes

Introduction

Posted on: Aug 20, 2024

Amazon S3 adds support for conditional writes that can check for the existence of an object before creating it. This capability … More on:

Link to AWS post: Click here Link to AWS doc: Click here


Example Usage

  • How to prevent object overwrites with conditional writes
  • The following S3 APIs support using conditional writes:
  1. PutObject
aws s3api put-object --bucket amzn-s3-demo-bucket --key dir-1/my_images.tar.bz2 --body my_images.tar.bz2 --if-none-match "*"    
  1. CompleteMultipartUpload
aws s3api complete-multipart-upload --multipart-upload file://mpustruct --bucket amzn-s3-demo-bucket --key dir-1/my_images.tar.bz2 --upload-id uploadID --if-none-match "*"