Where data stored if I use Glacier Flexible Retrieval class?
I have some data in Glacier Flexible Retrieval , and I want to clear those data, please tell me how to do this. I have searched for the Internet. However, I only find CLI command to delete Glacier vaults only
Answer from AWS:
Hello,
Thank you for contacting AWS Premium Support. My name is Christopher and I will be helping with your case today.
From the case notes, I understand that you would like to know where to find the objects that are using the Glacier Flexible Retrieval storage class; and how to delete them. Please let me know if I have missed or misunderstood anything.
\===============================================================================================================
Before answer to your question let me explain difference between S3 Glacier [1] as service and S3 Glacier storage (Flexible Retrieval) class [2]. Please note S3 Glacier is a dedicated service for storing files in a Glacier vault where as S3 Glacier (Flexible Retrieval) /Glacier-Deep-Archive storage classes allow you to store objects/files within an s3 bucket using those particular storage classes.
While using S3 Glacier (Flexible Retrieval) storage class or Deep Archive storage class, you are basically uploading an object to the bucket using the S3’s api endpoint and mentioning the Storage Class to be Glacier/Glacier Deep Archive. In this case, you would be able to list the objects normally by using the list-objects api call as well as delete the objects normally using the “delete-object” api call.
\===============================================================================================================
In regard to your questions:
[1- Question]:
Where data stored if I use Glacier Flexible Retrieval class?
[1- Response]:
As previously mentioned, depending on which S3 bucket you stored your S3 object with the “Glacier Flexible Retrieval” storage class, in that S3 bucket will be the objects you want to delete.
[2- Question]:
I have some data in Glacier Flexible Retrieval , and I want to clear those data, please tell me how to do this.
I have searched for the Internet. However, I only find CLI command to delete Glacier vaults only
[2. Response]:
To delete objects/files that are using the Glacier (Flexible Retrieval) storage class in one of your S3 bucket, you can use one of the following options:
By using the AWS S3 console page, using the AWS SDKs or by using the REST API, for more information about the different options, you can check the following doc [3].
Please note, although the delete requests are free [4-5], however there is a minimum storage duration for objects that are in Glacier which is 90 days, so if you delete an object that is stored in glacier and the object has less then 90 days in Glacier you still pay for the object storage till 90 days [6].
Moreover, before you proceed to delete an objects, please verify that is the desire object to delete which is in the “Glacier Flexible Retrieval storage” class, for example see image “S3 objects Glacier Flexible Retrieval”.
\===============================================================================================================
I hope the above information helps you. As always, should you have any additional queries or concerns, please do not hesitate to get reply on this email, as I would be happy to help you.
Thank you and Have a lovely day ahead!
\=========References============
[1] What Is Amazon S3 Glacier? – https://docs.aws.amazon.com/amazonglacier/latest/dev/introduction.html
[2] Using Amazon S3 storage classes – https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html
[3] Deleting multiple objects – https://docs.aws.amazon.com/AmazonS3/latest/userguide/delete-multiple-objects.html
[4] Why am I charged an early delete fee for Amazon S3 Glacier? – https://aws.amazon.com/premiumsupport/knowledge-center/glacier-early-delete-fees/
[5] Requests and data retrieval – https://aws.amazon.com/s3/pricing/
[6] Q: Are there minimum storage duration and minimum object storage charges for Amazon S3 Glacier Flexible Retrieval? – https://aws.amazon.com/s3/faqs/#How_am_I_charged_for_deleting_data_that_is_less_than_3_months_old
We value your feedback. Please share your experience by rating this correspondence using the AWS Support Center link at the end of this correspondence. Each correspondence can also be rated by selecting the stars in top right corner of each correspondence within the AWS Support Center.
Best regards,
Christopher H.
Amazon Web Services
Attachments
Comment: Sử dụng CLI:
Sử dụng AWS CLI
Bạn có thể sử dụng AWS CLI sample dưới đây để get list S3 object mà thuộc Storage class [Glacier Flexible Retrieval] [1]
Bằng Windows
aws s3api list-objects --bucket <your_bucket_name> --query "Contents[?StorageClass==`GLACIER`][Key]" --output text
Bằng Linux
aws s3api list-objects --bucket <your_bucket_name> --query 'Contents[?StorageClass==`GLACIER`][Key]' --output text
Bạn có thể xóa S3 object được trả về tại kết quả của command trên bằng command AWS CLI [aws s3api delete-object] [2]
Tài liệu tham khảo:
[1] [aws s3api list-objects]
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/list-objects.html
[2] [aws s3api delete-object]
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/delete-object.html