1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mac環境でのAWS-CLIのセットアップ

Last updated at Posted at 2019-04-17

作業ログとして記載。

概要

Mac環境にawscliの設定を実施する手順(作業時間5分)

1. Python及びawscliのインストール

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py
pip install awscli

上記が失敗する場合は、以下で実行

pip install awscli --user

I-Taka-MBA:~ root# aws --version 
aws-cli/1.16.141 Python/2.7.10 Darwin/17.7.0 botocore/1.12.131
I-Taka-MBA:~ root#

2. CLIの設定(アクセスキー・シークレットキーの設定)

I-Taka-MBA:~ root# aws configure
AWS Access Key ID [None]: ****************(アクセスキー)
AWS Secret Access Key [None]: ****************(シークレットキー)
Default region name [None]: us-east-2(デフォルトで使うリージョン)
Default output format [None]: json(コマンド結果のデフォルト出力形式:json/text/table)
I-Taka-MBA:~ root#

3. awscliコマンド確認

I-Taka-MBA:~ root# aws ec2 describe-instances
{
    "Reservations": [
        {
            "Instances": [
                {
                    "Monitoring": {
                        "State": "disabled"
                    }, 
                    "PublicDnsName": "ec2-xx-xxx-xxx-xxx.us-east-2.compute.amazonaws.com", 
                    "State": {
                        "Code": 16, 
                        "Name": "running"
                    }, 
                    "EbsOptimized": false, 
                    "LaunchTime": "2019-04-17T13:17:50.000Z", 
                    ], 

(以下省略)
I-Taka-MBA:~ root# aws s3 ls 
2019-04-07 19:08:27 ********
2018-02-21 23:28:35 ********
2017-05-25 23:08:47 ********
I-Taka-MBA:~ root# 
I-Taka-MBA:~ root# aws ec2 stop-instances --instance-ids i-***************
{
    "StoppingInstances": [
        {
            "InstanceId": "i-***************", 
            "CurrentState": {
                "Code": 64, 
                "Name": "stopping"
            }, 
            "PreviousState": {
                "Code": 16, 
                "Name": "running"
            }
        }
    ]
}
I-Taka-MBA:~ root#

参考にさせていただいたサイト

・awscliのインストール時のエラーへの対応
https://qiita.com/iwaseasahi/items/9d2e29b02df5cce7285d

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?