Skip to content

Instantly share code, notes, and snippets.

@johnsyweb
Created September 29, 2016 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnsyweb/61180592c823cf018b36e9e3838c6bb1 to your computer and use it in GitHub Desktop.
Save johnsyweb/61180592c823cf018b36e9e3838c6bb1 to your computer and use it in GitHub Desktop.
for region in $(aws ec2 describe-regions --region ap-southeast-1 --query 'Regions[].RegionName' --output=text); do
echo "EC2 instances in ${region}..."
aws ec2 describe-instances --region ${region} --query 'Reservations[].Instances[].Tags[?Key==`Name`].Value' --output=text
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment