Skip to content

kadenbarlow/awsctx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Awsctx

I spend a lot of time doing bouncing between aws accounts and I couldn't find an easy way to manage the different access keys I had. After using an awesome kuberneetes tool called kubectx I was inspired to create a similar tool but for switching between different aws accounts.

Installing

Prerequisites

  1. jq
  2. aescrypt
    1. Note, if on MacOS do not use brew install aescrypt, instead download from the link above
  3. fzf - optional for fuzzy search menus

Installing Awsctx

git clone https://github.com/kadenbarlow/awsctx.git
cd awsctx
cp awsctx /usr/local/bin/awsctx

Usage

USAGE:
  awsctx                       : list the contexts
  awsctx <NAME>                : switch to context <NAME>
  awsctx -                     : switch to the previous context
  awsctx -e, --export <NAME>   : export context as env, e.g. source awsctx -e <name>
  awsctx -c, --current         : show the current context name
  awsctx -s, --set <NAME>      : fill ~/.aws/credentials with context variables
  awsctx -n, --new             : create a new aws context
  awsctx -p, --password        : change encryption password
  awsctx <NEW_NAME>=<NAME>     : rename context <NAME> to <NEW_NAME>
  awsctx <NEW_NAME>=.          : rename current_context to <NEW_NAME>
  awsctx -d <NAME> [<NAME...>] : delete context <NAME> ('.' for current_context)
                                  (this command won't delete the credentials in ~/.aws/credentials)
  awsctx -h,--help             : show this message

Keeping Credentials Secure

Awsctx uses aescrypt to store credentials securely. Although the option is provided to set credentials in the ~/.aws/credentials file, using the command awsctx -s <NAME>, it is recommended to source the credentials in your environment when needed to avoid storing credentials in plain text. To do this use the command source awsctx -e and your credentials will be set to the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

CLI Tool for Managing AWS Account Keys

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages