问题描述
我正在运行此AWS CLI命令来获取AMI ID的列表以及它们的ImageSize,但是我无法列出ImageSize并将其显示为单独的列。
aws ec2 describe-images --owners self --region us-east-1 --profile prod
--query 'Images[*].[Name,ImageId,VolumeSize,Description,ImageLocation,OwnerId,Public,State,CreationDate,Platform,RootDeviceType,VirtualizationType,Tags[?Key==`System`]|[0].Value,Tags[?Key==`SubSystem`]|[0].Value,BlockDeviceMappings[]|[].Ebs.VolumeSize]'
--output text
有人可以在这里帮助我吗?这样我的表中可以有这些部分,如mysampletable图片所示:
解决方法
根据the documentation,make install
CLI命令不会返回aws ec2 describe-images
。但是,它返回ImageSize
,您已经在查询中检索到了它。