An open API service indexing awesome lists of open source software.

https://github.com/kadenbarlow/awsctx

CLI Tool for Managing AWS Account Keys
https://github.com/kadenbarlow/awsctx

account aws cli management tool

Last synced: 3 months ago
JSON representation

CLI Tool for Managing AWS Account Keys

Awesome Lists containing this project

README

          

# 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](https://github.com/ahmetb/kubectx) I was inspired to create a similar tool but for switching between different aws accounts.

## Installing

### Prerequisites
1. [jq](https://stedolan.github.io/jq/)
2. [aescrypt](https://www.aescrypt.com/)
1. Note, if on MacOS do *not* use `brew install aescrypt`, instead download from the link above
3. [fzf](https://github.com/junegunn/fzf) - optional for fuzzy search menus

### Installing Awsctx
```bash
git clone https://github.com/kadenbarlow/awsctx.git
cd awsctx
cp awsctx /usr/local/bin/awsctx
```

## Usage
```bash
USAGE:
awsctx : list the contexts
awsctx : switch to context
awsctx - : switch to the previous context
awsctx -e, --export : export context as env, e.g. source awsctx -e
awsctx -c, --current : show the current context name
awsctx -s, --set : fill ~/.aws/credentials with context variables
awsctx -n, --new : create a new aws context
awsctx -p, --password : change encryption password
awsctx = : rename context to
awsctx =. : rename current_context to
awsctx -d [] : delete context ('.' 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 `, 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

* **Kaden Barlow** - [kadenbarlow](https://github.com/kadenbarlow)

## License

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