Created
January 11, 2017 02:52
-
-
Save hokkai7go/8a8ddf250cd35b437543e049e885a969 to your computer and use it in GitHub Desktop.
EC2インスタンスの一覧を出したときのスクリプト
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
AWS_PROFILE=hoge aws ec2 describe-instances | jq -r '["InstanceName","PrivateIpAddress","PublicIpAddress","InstanceId","InstanceType","AvailabilityZone","State.Name","Platform"],(.Reservations[].Instances[] | [(.Tags[] | select(.Key=="Name").Value) // "", .PrivateIpAddress, .PublicIpAddress, .InstanceId, .InstanceType, .Placement.AvailabilityZone, .State.Name, .Platform])|@csv' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment