Question about Object Lock

0

I was reading https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html

It says "In governance mode, users can't overwrite or delete an object version..." - I am not sure what it means by "overwriting an object version" My understanding is that, for a versioned bucket, a new version is always created when uploading with the same name. So, is this referring to the case of unversioned buckets?

Thanks.

jacob
asked 2 years ago532 views
1 Answer
0

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

AWS
answered 2 years 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.

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