简体   繁体   English

是否可以按类型(即标准,标准IA,减少冗余)列出s3个存储桶?

[英]Is it possible to list s3 buckets by type i.e. Standard, Standard IA, Reduced Redundancy?

I am trying to audit my buckets to see which buckets have what type of storage configuration. 我正在尝试审核我的存储桶,以查看哪些存储桶具有哪种类型的存储配置。 Is it possible to list s3 buckets by type with the aws cli ie Standard, Standard IA, Reduced Redundancy? 是否可以通过aws CLI(即标准,标准IA,减少冗余)按类型列出s3个存储桶?

You can use the AWS Command-Line Interface (CLI) to only list objects of a particular storage class: 您可以使用AWS命令行界面(CLI)仅列出特定存储类的对象:

aws s3api list-objects-v2 --bucket my-bucket --query 'Contents[?StorageClass==`STANDARD_IA`].[Key]' --output text

Or, if you have a large quantity of objects, you might consider using Amazon S3 Inventory , which can provide a regular list of objects, including their Storage Class. 或者,如果您有大量对象,则可以考虑使用Amazon S3库存 ,它可以提供常规的对象列表,包括它们的存储类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM