Created
November 24, 2015 19:42
-
-
Save Sjeanpierre/f8dbafbf66001ecb4180 to your computer and use it in GitHub Desktop.
Report running instances across all regions in AWS
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
regionlist=($(aws ec2 describe-regions --query Regions[*].RegionName --output text)) | |
for region in "${regionlist[@]}" | |
do | |
aws --region $region ec2 describe-instances --output text --query 'Reservations[*].Instances[*].[Tags[?Key==`Name`] | [0].Value,PrivateIpAddress,InstanceId,State.Name,InstanceType,Placement.AvailabilityZone,LaunchTime]' --filters 'Name=tag:Name,Values=*' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment