Last active
November 11, 2016 00:28
-
-
Save florin-andrei-curbside/3f4efdd98f454cbe1617f1152ff06c13 to your computer and use it in GitHub Desktop.
list all API instances in all regions
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
for reg in `aws ec2 describe-regions --query 'Regions[].[RegionName]' --output=text`; do | |
aws --region=${reg} ec2 describe-instances --filters "Name=tag:Name, Values=api-*" \ | |
--query 'Reservations[].Instances[].[PrivateIpAddress, Tags[?Key==`Name`] | [0].Value]' \ | |
--output=text | grep -v ^None | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment