■作業概要
Amazon Web ServiceのAPIツールを使えるように準備する
■作業内容
mkdir -p /root/.aws/
Awsにログイン⇒アカウント/コンソール⇒セキュリティ認証情報⇒アクセス証明書: アクセスキー、X.509 証明書、一対の鍵
⇒「X.509証明書」⇒新しい証明書を作成するからダウンロードする
ダウンロードした証明書を/root/.aws/以下へ保存する
yum install java
cd /root/
wget "http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip"
unzip ec2-api-tools.zip
ln -s ec2-api-tools-1.6.12.2 ec2-api-tools
cp -p .bashrc .bashrc_20140207
vi .bashrc
export EC2_PRIVATE_KEY=/root/.aws/pk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem
export EC2_CERT=/root/.aws/cert-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem
export EC2_HOME=/root/ec2-api-tools
export EC2_URL=https://ec2.ap-northeast-1.amazonaws.com
export JAVA_HOME="/etc/alternatives/jre"
export PATH=$EC2_HOME/bin:$PATH
. ~/.bashrc
which ec2-describe-regions
/root/ec2-api-tools/bin/ec2-describe-regions
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
REGION ap-southeast-2 ec2.ap-southeast-2.amazonaws.com