2
0

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 3 years have passed since last update.

AWS CLIで複数アカウント(認証情報)を簡単に切り替える方法

Last updated at Posted at 2020-01-16

はじめに

以下の状況を踏まえ、備忘録を兼ねてアカウント切替え方法をまとめます。

  • 異なるアカウントで操作する機会が増えた
  • aws configureで認証情報を毎回入力して切替えるのが煩わしい

#Profileを作成する

コマンド
aws configure --profile [profile]

↓↓↓ 作成サンプル
image.png

↓↓↓ 作成先は以下の2ファイル
・C:\Users[ユーザー名].aws\credentials

credentials
[test]
aws_access_key_id = test
aws_secret_access_key = test

・C:\Users[ユーザー名].aws\config

config
[profile test]
output = test
region = test

#Profileを切り替える

AWS_DEFAULT_PROFILE
set AWS_DEFAULT_PROFILE=[Proflie]

↓↓↓ 実行サンプル
image.png

#コマンド補足

コマンド
`認証状況`
aws configure list
2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?