awsprof

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2017 License: MIT

README

awsprof

GoDoc  Build Status  Go Report Card

awsprof is a little tool to quickly switch your AWS access and secret key environment variables using profile names. Many AWS tools and APIs support the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, but they don't support the profile system - awsprof aims to help resolve that.

Install

Download a binary from the Releases page, or if you have a valid Go installation you can install from source:

$ go get github.com/KyleBanks/awsprof/cmd/awsprof

Usage

awsprof can be run with either no arguments to view the names of all configured profiles. If one of the profiles matches the current AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, it will be marked as the active profile with an asterisk:

$ awsprof
 * default
   devops
   production
   website

Alternatively, running awsprof with a profile name allows you to activate the pair of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables associated with that profile. Unfortunately, due to the nature of environment variables, and the fact that a child process cannot set environment variables for the parent, awsprof can only output the export commands which you can then run:

$ awsprof website
export AWS_ACCESS_KEY_ID='EXAMPLE'
export AWS_SECRET_ACCESS_KEY='EXAMPLE'

You can either copy and paste the command to run it yourself, or more efficiently:

$ eval $(awsprof website)

For frequent usage, add an alias to your ~/.bash_profile:

# ~/.bash_profile

alias awsprof-website="eval \$(awsprof website)"

And run it like so:

$ awsprof-website

Author

awsprof was developed by Kyle Banks.

License

awsprof is available under the MIT license.

Directories

Path Synopsis
cmd
Package credentials provides the ability to parse and represent an AWS credentials file.
Package credentials provides the ability to parse and represent an AWS credentials file.

Jump to

Keyboard shortcuts

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