こんにちは。Takitaです。
PCを新調して再度awscliのセットアップをしたので手順をまとめてみました。
brewを使っている場合は以下のコマンドでawscliをインストールします。
$ brew install awscli
$ aws --version
aws-cli/1.11.138 Python/2.7.10 Darwin/16.7.0 botocore/1.6.5
macOS, linuxは以下のドキュメントを参照してください。。
http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-bundle-other-os
http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-linux.html
$ aws configure
AWS Access Key ID [None]: xxxxx
AWS Secret Access Key [None]: xxxxx
Default region name [None]: ap-northeast-1
Default output format [None]: (None = json)
$ aws configure --profile xxxxx(ぼくはサービス名にしてます)
AWS Access Key ID [None]: xxxxx
AWS Secret Access Key [None]: xxxxx
Default region name [None]: ap-northeast-1
Default output format [None]: (None = json)
S3のバケット一覧を表示してみます。
$ aws s3 ls --profile xxxxx
2016-04-20 17:36:58 hoge
2016-01-05 16:01:31 fuga
デフォルトの設定をしている場合は、 --profile
を指定しなくてもOKです。
$ aws s3 ls
2016-04-20 17:36:58 hoge
2016-01-05 16:01:31 fuga