awsのprofile確認、切り替え
確認
$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key XXXXXXXXXX shared-credentials-file
secret_key XXXXXXXXXX shared-credentials-file
region <not set> None None
切り替え
export AWS_PROFILE=切り替えたいprofile名
確か このコマンドだとターミナル終了まで有効で、 AWS_DEFAULT_PROFILE=とかにしたらデフォルトが切り替えられる。
defaultを無効化
ちなみに、
- ~/.bash_profile
- ~/.aws/credentials
- ~/.aws/config
あたりから全部defaultを消してターミナルを再起動すると、
全てnot setになる。
プロジェクトのdotenvよりグローバルの設定が勝ってしまうので、
やっておくと便利だと思う。
$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key <not set> None None
secret_key <not set> None None
region <not set> None None
参考記事
[https://qiita.com/crossroad0201/items/f84b3e2fece41750755b:embed:cite]