1
0

More than 3 years have passed since last update.

AWS CLIでプロファイルを管理するコマンドあれこれ

Last updated at Posted at 2020-05-08

業務で複数のAWSアカウントを管理する必要が出てきたので、関連するコマンドを纏めてみた。

プロファイルを追加する

produserはプロファイル名。好きな名前を指定して良い。

aws configure --profile produser

プロファイルの一覧を確認する

これはAWS CLIコマンドではないが、コマンドによって作られた設定ファイルを直接確認する。

cat ~/.aws/credentials

コマンド単位でプロファイルを指定する

aws s3 ls --profile produser

プロファイルを切り替える

export AWS_PROFILE=user1

現在のプロファイルを確認する

echo $AWS_PROFILE

現在の接続先を確認する

aws configure list [--profile profile-name]
1
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
1
0