Created
August 8, 2019 14:34
-
-
Save kondanta/ea1a926bb93c4322011e68cb7218c5d1 to your computer and use it in GitHub Desktop.
Finding instances on aws with "Name" tag.
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/sh | |
| aws --region "$1" ec2 describe-instances --query 'Reservations[].Instances[?Tags[?Key == `Name` && contains(Value, `'"$2"'`)][]][].{ip:PublicIpAddress, type:InstanceType, name:[Tags[?Key==`Name`].Value][0][0]}' | jq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment