awsdefault

command
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

README

awsdefault — cli tool

Usage

List all available AWS profiles

  • command:
$ awsdefault ls
  • example output:
dev
live
personal

Show the current used AWS profile

  • command:
$ awsdefault is
  • example output:
live

Change the default AWS profile to 'personal'

  • command:
$ awsdefault to personal

Disable/unset the AWS profile

command:

$ awsdefault rm

Show the AWS_ACCESS_KEY_ID of currently used profile

command:

$ awsdefault id
  • example output:
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
  • example output:
aaaaeenntrnggg/trntruaelvii

Print the export command for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY of currently used profile

command:

$ awsdefault export
  • example output:
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

Configure your environment (only first time)

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL