Difference between revisions of "Aws-ec2-describe-instances-all-regions"
Jump to navigation
Jump to search
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
− | for region in `aws ec2 describe-regions -- | + | Using <code>[[parallel]]</code>: |
+ | [[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 | ||
[[echo -e]] "\nListing Instances in region:'$region'..." | [[echo -e]] "\nListing Instances in region:'$region'..." | ||
[[aws ec2 describe-instances]] --region $region | [[aws ec2 describe-instances]] --region $region | ||
done | 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 == | == Related == | ||
+ | * <code>aws ec2 describe-regions --all-regions --query "Regions[].{Name:RegionName}" --output text</code> | ||
* <code>[[aws ec2 describe-regions]] --query Regions[*].[RegionName] --output text</code> | * <code>[[aws ec2 describe-regions]] --query Regions[*].[RegionName] --output text</code> | ||
* <code>[[suaws]]</code> | * <code>[[suaws]]</code> | ||
+ | * <code>[[aws-all-regions]]</code> | ||
== See also == | == See also == |
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]
aws ec2 describe-regions --all-regions --query "Regions[].{Name:RegionName}" --output text
aws ec2 describe-regions --query Regions[*].[RegionName] --output text
suaws
aws-all-regions
See also[edit]
- AWS EC2, AWS::EC2,
aws ec2
[describe-instances | describe-instance-status
|run-instances | terminate-instances | stop-instances
|tags
|describe-vpcs
|describe-addresses
|describe-availability-zones
|describe-subnets
|import-key-pair
|create-key-pair
|create-vpc
|create-internet-gateway
|modify-instance-attribute | ec2-instance-connect | get-console-output
] - AWS EC2, Amazon EC2 API,
aws ec2, AWS::EC2
, Amazon EC2 Spot Instances, CPU credits, Instance type, EC2 limitations, 169.254.169.254, Instance metadata and user data (IMDS),InstanceType, InstanceId
, Amazon EC2 Auto Scaling, AWS EC2 Instance Connect, launch template, lifecycle, AWS Security group (SG), Amazon EC2 Recycle Bin, Amazon EC2 Mac Instances, Global View
Advertising: