- Newest
- Most votes
- Most comments
Hello
When you create a bucket with Object Lock enabled, Amazon S3 automatically enables versioning for the bucket. Object Lock works only in versioned buckets, and retention periods and legal holds apply to individual object versions. When you lock an object version, Amazon S3 stores the lock information in the metadata for that object version. Placing a retention period or legal hold on an object protects only the version specified in the request. It doesn't prevent new versions of the object from being created.
If you put an object into a bucket that has the same key name as an existing protected object, Amazon S3 creates a new version of that object, stores it in the bucket as requested, and reports the request as completed successfully. The existing protected version of the object remains locked according to its retention configuration. You can refer following link for more: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 months ago
Thanks. I was confused by the part "users can't overwrite.." - in my understanding, even without object lock, users can't overwrite an object version?
Hello
Since the bucket have versioning turned on, when a user uploads the object with same key/overwrite an object, it results in creation of new object version and the old object is still stored as previous version. This allows you to restore the previous version. Hope that helps.