通过aws cli仅列出AWS EBS卷的私有快照

问题描述 投票:0回答:1

您好,我尝试通过 AWS CLI 仅列出 AWS EBS 卷的私有快照,但在网上找不到任何参考来继续操作。请专家帮忙吗?

aws ec2 describe-snapshots --query 'Snapshots[*].[SnapshotId,VolumeId,VolumeSize,StartTime,Description]' --region eu-west-2 --output json   
amazon-web-services amazon-ec2 aws-cli
1个回答
1
投票

由于私有快照是您所拥有的快照,因此您可以将输出限制为仅属于“自己”所拥有的快照。此外,如果您想要与特定卷关联的内容,则可以对其进行过滤。例如:

aws ec2 describe-snapshots --owner-ids self --filter Name=volume-id,Values=vol-060e26663d9fb1c67

当然,您希望将卷 ID 替换为您自己的。

© www.soinside.com 2019 - 2024. All rights reserved.