Last active
August 26, 2019 06:41
-
-
Save pm-hwks/6dc9db33f5779700bfe8ae401e845c88 to your computer and use it in GitHub Desktop.
[awscli - list of AWS instances] Using awscli & jq, get a list of running aws instances #aws #cli #awscli #jq #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
# Note : (pre-reqs) : Install & configure AWSCLI, install jq | |
aws ec2 describe-instances | tee /tmp/ins | | |
jq --raw-output '.Reservations[].Instances[0] | [ .InstanceId, .PublicIpAddress , .PrivateIpAddress, .PrivateDnsName, | |
(.Tags[] | select(.Key == "Name") | .Value ) ] | @tsv ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment