Home > OS >  AWS CLI - aws ec2 describe-volumes can't ouput volume size and volume type in a table
AWS CLI - aws ec2 describe-volumes can't ouput volume size and volume type in a table

Time:07-06

I'm trying to get a table of all ebs volume ID's, the instance ID's their attached to and the size/type of the volume via the AWS CLI. While the ID's are working fine, I'm not getting any output for the size/type.

I tried the following command:

aws ec2 describe-volumes --output table --query 'Volumes[*].Attachments[0].{VolumeID:VolumeId,InstanceID:InstanceId,size:Size,type:VolumeType}'

And I got this output:

Output_EBS-List

Thanks for helping! :)

CodePudding user response:

aws ec2 describe-volumes --query 'Volumes[*].{VolumeID:Attachments[0].VolumeId,InstanceID:Attachments[0].InstanceId,size:Size,type:VolumeType}'
  • Related