-
-
Save albarki/488721240bd62f3e47bc081b0bd9b957 to your computer and use it in GitHub Desktop.
Get List of EC2 instances from All regions
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
# install aws cli first | |
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