Skip to content

Instantly share code, notes, and snippets.

@Klaudioz
Created June 18, 2020 15:09
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 Klaudioz/3993d8cea1f6d7120d2a1bf9384a31aa to your computer and use it in GitHub Desktop.
Save Klaudioz/3993d8cea1f6d7120d2a1bf9384a31aa to your computer and use it in GitHub Desktop.
for region in `aws ec2 describe-regions --output text | cut -f3`
do
echo -e "\nListing Instances in region:'$region'..."
aws ec2 describe-instances --query "Reservations[*].Instances[*].{IP:PublicIpAddress,ID:InstanceId,Type:InstanceType,State:State.Name,Name:Tags[0].Value}" --output=table --region $region
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment