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
已提問 2 年前檢視次數 546 次
1 個回答
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
已回答 2 年前
  • 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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南