Skip to content

Instantly share code, notes, and snippets.

@takekawa
Created April 14, 2014 00:34
Show Gist options
  • Save takekawa/10608205 to your computer and use it in GitHub Desktop.
Save takekawa/10608205 to your computer and use it in GitHub Desktop.
全てのリージョンのインスタンスの一覧を確認する
# 全てのリージョンのインスタンスの一覧を確認する
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