Created
April 14, 2014 00:34
-
-
Save takekawa/10608205 to your computer and use it in GitHub Desktop.
全てのリージョンのインスタンスの一覧を確認する
This file contains 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
# 全てのリージョンのインスタンスの一覧を確認する | |
EC2_REGIONS=("us-east-1" "us-west-1" "us-west-2" "eu-west-1" "ap-southeast-1" "ap-southeast-2" "ap-northeast-1" "sa-east-1") | |
for reg in ${EC2_REGIONS[@]}; do | |
export AWS_DEFAULT_REGION=$reg | |
aws ec2 describe-instances | jq -r "@csv \"$reg, \(.Reservations[].Instances[] | [.InstanceId, .State.Name, .Tags[0].Value,.InstanceType]) \"" | |
done | |
#参考 | |
# http://inokara.hateblo.jp/entry/2014/01/17/163949 | |
# http://blog.serverworks.co.jp/tech/2014/01/07/awsec2pricing/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment