Permanently delete from Glacier Deep Archive

0

How do I purge (permanently delete) files in Glacier Deep Archive?

已提问 10 个月前659 查看次数
2 回答
2
profile pictureAWS
专家
已回答 10 个月前
profile picture
专家
已审核 10 个月前
profile picture
专家
已审核 10 个月前
  • Thank you for the quick response.

  • To be clear, those links are not about S3 objects in the Glacier Deep Archive storage class. They are about the separate S3 Glacier service, which uses a completely different set of APIs from the regular S3 objects in the Deep Archive storage class discussed here. Most users should regard the S3 Glacier service as a legacy remnant they should never touch.

0

If you want to empty a specific prefix ("folder name") or the entire bucket, the most general way to do it right while avoiding unexpected costs is to create a lifecycle rule in your bucket. You would filter it by prefix, if the whole bucket isn't to be emptied, and set the action to expire the objects. If the bucket is not versioning-enabled, that's all that is needed. If the bucket is versioning-enabled, you'll need one rule to make the "current" versions "past" versions first, and a second rule to cause the "past" versions to be deleted permanently.

Lifecycle rules start getting executed at midnight UTC time and may take many, many hours to complete. If you aren't dealing with astronomical numbers of objects, I would guess it would complete by the following evening (in UTC time).

If you want to be more selective than emptying an entire prefix/folder/bucket, such as only deleting objects in Deep Archive but not objects with the same prefix (in the same "folder") but in different storage classes, then the operation gets more complex. For example, you could create an S3 Batch Job to produce an inventory report, tag the objects based on their storage class, and then target the lifecycle rule based on the tag instead of a prefix. You'll want to note that inventory reports, batch jobs, and tagging requests are billable operations, although unless the numbers of objects are huge, they are rather inexpensive. It's best to check against the metrics for your bucket and the pricing calculator, though.

Lifecycle rules are explained in detail starting with this documentation article: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html, and "expiring" (=deleting objects/files or marking them as deleted) in more detail here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-expire-general-considerations.html

专家
已回答 10 个月前
profile picture
专家
已审核 10 个月前
  • Thank you for the quick response. I'm new to AWS and haven't used lifecycle rules but can look through the documentation. I should be able to identify and download the few files we need to keep, and then eliminate the folder with the lifecycle rules.

  • I updated the text with links to the relevant parts of the documentation about lifecycle rules. You can find them by opening your S3 bucket in the console and clicking the "Management" tab. Lifecycle rules are configured at the top of the screen.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则