Last active
October 22, 2020 20:48
-
-
Save gmirsky/01af31863cee6b45b541f18dc66fea82 to your computer and use it in GitHub Desktop.
Instance Report JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/bash | |
XXX=$(aws ec2 describe-instances \ | |
--filters "Name=tag-key,Values=Name" \ | |
--query 'Reservations[*].Instances[*].{Instance:InstanceId, Type:InstanceType, Platform:Platform, Volumes:BlockDeviceMappings[*].Ebs.VolumeId, NetworkInterfaces:PrivateIpAddress,AZ:Placement.AvailabilityZone, Name:Tags[?Key==`Name`]|[0].Value}' \ | |
--output json) | |
echo "$XXX" > xxx.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/bash | |
XXX=$(aws ec2 describe-instances \ | |
--filters "Name=tag-key,Values=Name" \ | |
--query 'Reservations[*].Instances[*].{Instance:[InstanceId, InstanceType, Platform,BlockDeviceMappings[*].Ebs.VolumeId],NetworkInterfaces:PrivateIpAddress,AZ:Placement.AvailabilityZone,Name:Tags[?Key==`Name`]|[0].Value}' | |
--output json) | |
echo "$XXX" > aws_test.json | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment