npandey
npandey

Reputation: 11

Query multiple AWS regions for active EC2 instances

Can we query multiple AWS regions at the same time?.

I want to query for data from multiple AWS regions through AWS CLI, for example, all the EC2 instances active in every region.

Upvotes: 0

Views: 16685

Answers (1)

Colwin
Colwin

Reputation: 2685

No there is no way to set multiple regions in one setting. You could do something like this

for region in `aws ec2 describe-regions --output text | cut -f3`
do
     echo -e "\nListing Instances in region:'$region'..."
     aws ec2 describe-instances --region $region
done

Upvotes: 8

Related Questions