Created
July 30, 2018 19:59
-
-
Save russellds/1e52df6e67d6bf6a61c62d72b60ba905 to your computer and use it in GitHub Desktop.
AWS Instance Details
This file contains hidden or 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
#!/bin/bash | |
echo 'InstanceId,KeyPair,PrivateIpAddress,PublicIpAddress,InstanceType,Tags,OwnerId' > $HOME/aws-instance-details.csv | |
aws ec2 describe-instances --filters --query 'Reservations[].Instances[].[InstanceId,KeyName,PrivateIpAddress,PublicIpAddress,InstanceType,Tags[?Key==`Name`].Value[]]' --output text | | |
sed 's/\t/,/g' >> $HOME/aws-instance-details.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment