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:
Thanks for helping! :)
CodePudding user response:
aws ec2 describe-volumes --query 'Volumes[*].{VolumeID:Attachments[0].VolumeId,InstanceID:Attachments[0].InstanceId,size:Size,type:VolumeType}'