Difference between revisions of "Aws-ec2-describe-instances-all-regions"

From wikieduonline
Jump to navigation Jump to search
 
Line 11: Line 11:
  
 
Prepending region name:
 
Prepending region name:
  aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text |  parallel  "aws eks list-clusters --output text --region {} | sed s/^/{}\" \"/ "
+
  aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text |  parallel  "aws ec2 describe-instances --output text --region {} | sed s/^/{}\" \"/ "
  
  

Latest revision as of 16:24, 14 February 2022

Using parallel:

aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text | parallel aws ec2 describe-instances --region {}

Using for expression:

for region in `aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text`; do
     echo -e "\nListing Instances in region:'$region'..."
     aws ec2 describe-instances --region $region
done

Prepending region name:

aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text |  parallel  "aws ec2 describe-instances --output text --region {} | sed s/^/{}\" \"/ "


Related[edit]

See also[edit]

Advertising: