LoginSignup
0

More than 5 years have passed since last update.

macにaws cliを入れて簡単な動作確認まで (今さら..)

Last updated at Posted at 2017-12-15

インストール

$ brew install awscli

初期設定/認証設定 (例)

$ aws configure --profile hoge1
AWS Access Key ID [None]: xxx
AWS Secret Access Key [None]: xxx
Default region name [None]: ap-northeast-1
Default output format [None]: json

※~/.aws 配下に config と credentials ファイルができる
※複数アカウントを設定して切り替えて使う予定なので --profile オプションを使用した。

動作確認

$ export AWS_PROFILE=hoge1
$ aws ec2 describe-regions
→リージョン一覧がJSONで表示されれば初期設定/認証設定はok

サンプル (sample.sh)

#!/bin/bash

### AWS
AWS_PROFILE=hoge1
#AWS_PROFILE=hoge1-ro

### main
export AWS_PROFILE

aws ec2 describe-regions

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
0