Help us understand the problem. What is going on with this article?

AWS CLIのインストール

More than 1 year has passed since last update.

AWS CLIのインストールのメモ

Windows

MSIインストーラのダウンロード & 実行

Linux、Unix or macOS

ダウンロード

コマンド
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
sudo python get-pip.py

Linux、Unix

コマンド
sudo pip install awscli

macOS

コマンド
#sixのアップグレード無視
sudo pip install awscli --upgrade --ignore-installed six

AWS CLI設定

aws configure実行

コマンド
aws configure
設定
AWS Access Key ID [None]: *************ID
AWS Secret Access Key [None]: ******************************KEY
Default region name [None]: ap-northeast-1
Default output format [None]: json

一時設定変更

  • Linux、Unix or macOS
コマンド
export AWS_ACCESS_KEY_ID=*************ID
export AWS_SECRET_ACCESS_KEY=******************************KEY
export AWS_DEFAULT_REGION=ap-northeast-1
export AWS_DEFAULT_OUTPUT=json
  • Windows
コマンド
set AWS_ACCESS_KEY_ID=*************ID
set AWS_SECRET_ACCESS_KEY=******************************KEY
set AWS_DEFAULT_REGION=ap-northeast-1
set AWS_DEFAULT_OUTPUT=json

設定確認

コマンド
aws configure list
結果
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************VNPA              env    
secret_key     ****************dSZJ              env    
    region           ap-northeast-1              env    AWS_DEFAULT_REGION

awscliのversionアップグレード

Windows

最新版のインストーラーをダウンロードし再インストールする。

Linux、Unix、macOS

コマンド
sudo pip install -U awscli

コマンド補完を有効にする

Linux、Unix、macOS(Unix似)のみ

 AWSコンプリータを見つける

whichで見つける
which aws_completer
findで見つける
find / -name aws_completer 2> /dev/null
結果
/usr/local/bin/aws_completer

 補完を有効にする。~/.bash_profileファイルの行末に追加すると便利

bashシェル
complete -C '/usr/local/bin/aws_completer' aws

 補完の確認

確認
aws ec2 describe-i <-ここでtab

下記のように出力される

結果
describe-iam-instance-profile-associations   describe-images                              describe-instance-credit-specifications 
describe-id-format                           describe-import-image-tasks                  describe-instance-status 
describe-identity-id-format                  describe-import-snapshot-tasks               describe-instances 
describe-image-attribute                     describe-instance-attribute                  describe-internet-gateways

以上。

yuyj109
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした