Last active
February 11, 2021 21:02
-
-
Save bil9000/2cf0d6bd88eb32faaa6feca815b0db2b to your computer and use it in GitHub Desktop.
finding aws ec2 stuff. This command grabs the InstanceID, Instance Name, PrivateIP and VPC
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
aws ec2 describe-instances \ | |
--filters Name=tag-key,Values=Name \ | |
--query 'Reservations[*].Instances[*].{Instance:InstanceId,Vpc:VpcId,PrivateIP:PrivateIpAddress,Name:Tags[?Key==`Name`]|[0].Value}' --output table >> instances.tsv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This command grabs the InstanceID, Instance Name, PrivateIPAddresss and VPC - it is best to have your aws configure run first or it will bomb. Then it dumps it out in to a tab-separated-value.