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

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
  
 +
Using [[parallel]]:
 +
aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text | [[parallel]] [[aws ec2 describe-instances]] --region {}
 +
 +
Using <code>[[for]]</code> expression:
 
  [[for]] region in `aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text`; do
 
  [[for]] region in `aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text`; do
 
       [[echo -e]] "\nListing Instances in region:'$region'..."
 
       [[echo -e]] "\nListing Instances in region:'$region'..."
Line 6: Line 10:
 
  done
 
  done
  
aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text | [[parallel]] [[aws ec2 describe-instances]] --region {}
 
  
 
== Related ==  
 
== Related ==  

Revision as of 18:42, 28 January 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


Related

  • aws ec2 describe-regions --all-regions --query "Regions[].{Name:RegionName}" --output text
  • aws ec2 describe-regions --query Regions[*].[RegionName] --output text
  • suaws

See also

Advertising: