AWS CLIの導入

概要

aws cliMacで使えるようになるまで。

手順

pythonのインストール

$ python --version

はいってた

aws cli のインストール

$ curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
$ sudo python get-pip.py
$ sudo pip install awscli --upgrade --ignore-installed six

インストールの確認

$ aws --version

認証の設定

aws configure set aws_access_key_id {IAMユーザのアクセスキーID}
aws configure set aws_secret_access_key {IAMユーザのアクセスキー}
  • ~/.aws/credentials に設定される

おまけ

Bundled Installer を使った手順

最初こっちでやってみたけどpipでやるほうが一般的みたい。

$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

Installing the AWS Command Line Interface - AWS Command Line Interface

アンイストール手順

$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws

Uninstalling the AWS CLI - AWS Command Line Interface

Pythonの導入

virtualenvで環境作ってpipが一般的らしい

Virtual Environments — The Hitchhiker's Guide to Python Pythonの仮想環境を構築できるvirtualenvを使ってみる - Qiita

メリットとしては下記。

  • 複数バージョンの利用
  • ライブラリ環境の独立性
  • 環境丸ごと他にコピーしたり入れ替えられたりする

参考

OS X EI Caption(10.11.1)でAWS CLIのインストールエラー - Qiita