参考: http://d.hatena.ne.jp/rx7/20100612/p1
全世界にあるregionのうちTOKYO(ap-northeast-1)しか使ってないのに、いちいちコマンドで--region
を指定するのは面倒だ。
$ ec2-describe-regions
REGION eu-west-1 ec2.eu-west-1.amazonaws.com
REGION sa-east-1 ec2.sa-east-1.amazonaws.com
REGION us-east-1 ec2.us-east-1.amazonaws.com
REGION ap-northeast-1 ec2.ap-northeast-1.amazonaws.com
REGION us-west-2 ec2.us-west-2.amazonaws.com
REGION us-west-1 ec2.us-west-1.amazonaws.com
REGION ap-southeast-1 ec2.ap-southeast-1.amazonaws.com
.bashrcとか.bash_profileあたりに以下の指定を追加する。
~/.bashrc
AWS_CREDENTIAL_FILE=/path/to/the/credential-file; export AWS_CREDENTIAL_FILE
EC2_PRIVATE_KEY=pk-xxxxxxxxxx.pem; export EC2_PRIVATE_KEY
EC2_CERT=cert-xxxxxxxxxxxxxxx.pem; export EC2_CERT
+EC2_URL=https://ec2.ap-northeast-1.amazonaws.com; export EC2_URL
+EC2_REGION=ap-northeast-1; export EC2_REGION
EC2_URLとEC2_REGION。