Is there a way to output the AWS cli with filters to csv format?
For example if I wanted to take this command and output to csv:
aws ec2 describe-images --owner self --query 'Images[*].{ID:ImageId,"Virtualization Type":VirtualizationType}'
How would I do that? Normally I would use jq to output the aws cli to csv. But in this case I was able to get to the info I wanted easier with the filter option instead of jq.
This is the full command I want to output to CSV:
aws ec2 describe-images --owner self --query 'Images[*].{ID:ImageId,"Virtualization Type":VirtualizationType,Architechture:Architecture,Hypervisor:Hypervisor,State:State,ImageID:ImageId,"Device Names":BlockDeviceMappings[].DeviceName,"Snapshot IDs":BlockDeviceMappings[].Ebs.SnapshotId,"Delete On Termination":BlockDeviceMappings[].Ebs.DeleteOnTermination,"Voluem Type":BlockDeviceMappings[].Ebs.VolumeType,"Volume Size":BlockDeviceMappings[].Ebs.VolumeSize,Encrypted:BlockDeviceMappings[].Ebs.Encrypted,"Image Location":ImageLocation,"Root Device Type":RootDeviceType,"Owner ID":OwnerId,"Creation Date":CreationDate,Public:Public,"Image Type":ImageType,Name:Name}'