AWS CLI設定
概要
AWS CLIを利用できるようにするEC2起動後、外部から接続できるように設定を実施する
1.python実行環境確認
・python2.6以降でないとpip(Pythonにおけるパッケージ管理システム)が利用できない
# python --version Python 2.6.6
2.EPELレポジトリを設定
# rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm # yum --enablerepo=epel update epel-release
3.python-pipをインストール
# yum install python-pip
4.AWS CLIをインストール
# pip install awscli
5.インストール確認
# which aws /usr/bin/aws # aws --version aws-cli/1.4.3 Python/2.6.6 Linux/2.6.32-431.el6.x86_64
6.CLI設定
# aws configure AWS Access Key ID [None]: hogehoge AWS Secret Access Key [None]: fugafuga Default region name [None]: ap-northeast-1 Default output format [None]:
7.コマンド実行
# aws ec2 describe-instances --output text RESERVATIONS 758393391893 r-b054edb6 GROUPS sg-c55369c4 Redhat_Repo INSTANCES 0 x86_64 hqUiG1398564367090 False xen ami-c9562fc8 i-3847293e t1.micro aki-176bf516 admin_aws 2014-04-27T02:06:07.000Z ip-10-132-7-48.ap-northeast-1.compute.internal 10.132.7.48 ec2-54-95-41-207.ap-northeast-1.compute.amazonaws.com 54.95.41.207 /dev/sda1 ebs None paravirtual BLOCKDEVICEMAPPINGS /dev/sda1 EBS 2014-04-27T02:06:11.000Z True attached vol-a39b46a9 MONITORING disabled PLACEMENT ap-northeast-1a None default SECURITYGROUPS sg-c55369c4 Redhat_Repo STATE 16 running TAGS Name RedHatRepo