S3 object lock on existing S3 objects?

0

Recently S3 launched a new feature around object lock where we can prevent individual objects from deletion from even the owner of the bucket for a specified period of time. This feature is only applicable for new objects uploaded. but what about the existing objects?

I have a lot of existing objects in my S3 bucket which I want to have object lock enabled on. What are the ways to achieve this?

AWS
專家
已提問 4 年前檢視次數 2016 次
3 個答案
2

To configure object lock on existing objects present in S3 bucket, below two steps are to be followed:

  1. The bucket should have object lock enabled. You can turn on Object Lock for an existing bucket from the "Properties" section of S3 bucket : https://aws.amazon.com/about-aws/whats-new/2023/11/amazon-s3-enabling-object-lock-buckets/
  2. Then, perform S3 batch operation to set the retention period for your existing objects. For this, you may first create S3 inventory report (which will contain the list of all the objects) for your S3 bucket and then perform S3 batch operation for setting Object Lock retention to apply retention dates (in either Governance or Compliance mode) on your existing objects.

Reference for S3 Inventory

Reference for S3 Batch operations and retention modes

You can also follow the guidelines outlined in this blog below to use S3 batch operation to set the retention period for your existing objects after enabling object lock on your bucket:

[+] https://aws.amazon.com/blogs/storage/how-to-manage-retention-periods-in-bulk-using-amazon-s3-batch-operations/

Note: If you use Inventory and S3 batch operations, you will incur additional charges, refer pricing document for additional details.

Hope you find this useful.

Neha_29
已回答 9 個月前
profile picture
專家
已審閱 1 個月前
0
已接受的答案

Enabling S3 Object Lock

You can only enable Object Lock for new buckets. If you want to turn on Object Lock for an existing bucket, contact AWS Support.

AWS
專家
已回答 4 年前
profile picture
專家
已審閱 1 個月前
-1

Enabling object locking on a bucket does not retroactively lock existing objects in the bucket. Object locking can only be applied to objects that are uploaded or copied to the bucket after object locking is enabled. If you want to apply object locking to existing objects in the bucket, you will need to make a copy of each object and then delete the original object. The copy of the object will have the object lock applied to it.

AWS
已回答 10 個月前

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

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

回答問題指南