gpt4 book ai didi

amazon-web-services - S3 中的对象锁是否有助于防止对象被覆盖?

转载 作者:行者123 更新时间:2023-12-03 22:06:39 24 4
gpt4 key购买 nike

我目前正在分析 S3 对象锁定功能,AWS 指定了以下内容,

S3 Object Lock is used to prevent an object from being deleted or overwritten for a fixed amount of time or indefinitely



但是 AWS 还指定用户启用 Versioning 以使用对象锁定。

如果启用版本控制,则默认情况下无法覆盖对象,因为它每次总是创建更新的版本。那么 S3 中的对象锁定如何帮助防止对象被覆盖?我在这里错过了什么吗?

最佳答案

来自 Locking Objects Using Amazon S3 Object Lock - Amazon Simple Storage Service :

Amazon S3 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.



因此,对象锁定不会阻止对象被覆盖或创建新版本。只有一个 具体版本的对象被锁定,无法删除。允许其他操作。

例如,我创建了一个对象并使用 Legal Hold 将其锁定。然后我 更名 物体。这导致添加了删除标记并使用更改的名称创建了一个新对象。

关于amazon-web-services - S3 中的对象锁是否有助于防止对象被覆盖?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56737084/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com