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
- Host: GitHub
- URL: https://github.com/kadenbarlow/awsctx
- Owner: kadenbarlow
- License: mit
- Created: 2020-03-19T20:11:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-21T12:39:19.000Z (about 4 years ago)
- Last Synced: 2025-04-06T17:24:04.457Z (6 months ago)
- Topics: account, aws, cli, management, tool
- Language: Shell
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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