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

awscliメモ

MACからの操作。

  • awscliはpythonなので入れる

    $ brew install python
    
  • pipでインストール

    $ pip install awscli
    
  • マネジメントコンソール画面からIAMユーザの作成
    参考:http://docs.aws.amazon.com/ja_jp/IAM/latest/UserGuide/Using_SettingUpUser.html

  • CSVのダウンロードはここでしかできないらしいので必ずしておく。

  • IAMユーザを作成したら「ポリシーのアタッチ」選択し「AmazonEC2FullAccess」あたりの権限を選択する。ほかのでもよい。

  • ダウンロードしたCSVをもとにIAMユーザ設定をローカルにしていく。

    $ aws configure
    AWS Access Key ID [None]: AKI***********HRQ
    AWS Secret Access Key [None]: ALuPJ**********************cNs41
    Default region name [None]: ap-northeast-1
    Default output format [None]: json
    
    $ ls -la ~/.aws/
    
    $ cat ~/.aws/config
    [default]
    output = json
    region = ap-northeast-1
    
    $ cat ~/.aws/credentials
    [default]
    aws_access_key_id = AKI***********HRQ
    aws_secret_access_key = ALuPJ**********************cNs41
    

ec2インスタンス一覧を出力する

    $ aws ec2 describe-instances

※「ポリシーのアタッチ」をしていないと以下のように権限がないと怒られる。

    $ aws ec2 describe-instances
A client error (UnauthorizedOperation) occurred when calling the DescribeInstances operation: You are not authorized to perform this operation.
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
ユーザーは見つかりませんでした