Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
8
Help us understand the problem. What is going on with this article?

More than 1 year has passed since last update.

@ezaqiita

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.
8
Help us understand the problem. What is going on with this article?
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
8
Help us understand the problem. What is going on with this article?