Usage
List all available AWS profiles
$ awsdefault ls
dev
live
personal
Show the current used AWS profile
$ awsdefault is
live
Change the default AWS profile to 'personal'
$ awsdefault to personal
Disable/unset the AWS profile
command:
$ awsdefault rm
Show the AWS_ACCESS_KEY_ID of currently used profile
command:
$ awsdefault id
AAAAAAABBBBIIIIII
- tip: use it in parameters or bash scripts
AWS_ACCESS_KEY_ID=$(awsdefault id)
Show the AWS_SECRET_ACCESS_KEY of currently used profile
command:
$ awsdefault key
aaaaeenntrnggg/trntruaelvii
Print the export command for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY of currently used profile
command:
$ awsdefault export
export AWS_ACCESS_KEY_ID=AAAAAAABBBBIIIIII
export AWS_SECRET_ACCESS_KEY=aaaaeenntrnggg/trntruaelvii
- tip: add an alias to your .bashrc or .zshrc like
alias awsexport='eval $(awsdefault export)'
Installation
Option 1 — Download binaries
precompiled binaries for Linux, Windows and MacOS are available at the [release] page.
curl
Option 2 — Compile it
Install the dependencies
- Go is required
- clone this repository:
$ go get github.com/peterbueschel/awsdefault
$ go get github.com/go-ini/ini
$ go get github.com/urfave/cli
Install the Go binary
Linux
$ cd $GOPATH/src/github.com/peterbueschel/awsdefault/cmd/awsdefault/ && go install
if everything went well, the binary can now be found in the directory $GOPATH/bin
Set the environment variable AWS_PROFILE
to default
(aws userguide).
Linux
Add the following line to your .xinitrc, .zshrc or .bashrc file:
export AWS_PROFILE=default
Windows
TODO