Change Amazon AWS profiles/accounts globally.
This tool sets one of your AWS profiles, configured in your $HOME/.aws/credentials file (see here), to the default profile. Means:
- adding parameters like
--profile=my-profileto the aws cli - or changing the environment variable with
export AWS_PROFILE=my-profilein every new terminal window
are not required anymore.
- command:
$ awsdefault to personalcommand:
$ awsdefault rmthe complete list of parameters can be found here
Note i3block was used as statusbar in this example. You can find the config in the doc folder.
TODO
precompiled binaries for Linux, (TODO: Windows and MacOS) are available at the [release] page.
curl Set the environment variable AWS_PROFILE to default (aws userguide).
Add the following line to your .xinitrc, .zshrc or .bashrc file:
export AWS_PROFILE=defaultTODO
The awsdefault (cli or UI) tool creates, changes or deletes the [default] profile section in your AWS credentials file. This default section contains the same aws_access_key_id and aws_secret_access_key as stored in one of the other profile sections.
Together with the configured environment variable AWS_PROFILE=default, this approach enables or disables the credentials of the specific AWS profile. In other words, the default profile points to the required profile or will be deleted if no profile is needed.
- The environment variable
$ env | grep AWS_PROFILE
AWS_PROFILE=default- The AWS credentials file — no default was set; default was unset
$ cat ~/.aws/credentials
[live]
aws_access_key_id = A
aws_secret_access_key = B
[dev]
aws_access_key_id = C
aws_secret_access_key = D
[personal]
aws_access_key_id = E
aws_secret_access_key = F- The AWS credentials file — default was set to personal (comment was added automatically)
$ cat ~/.aws/credentials
; active_profile=personal
[default]
aws_access_key_id = E
aws_secret_access_key = F
[live]
aws_access_key_id = A
aws_secret_access_key = B
[dev]
aws_access_key_id = C
aws_secret_access_key = D
[personal]
aws_access_key_id = E
aws_secret_access_key = FSee LICENSE.
