aws-vault-switch: Easily Switch Between AWS Profiles

aws-vault-switch is a Go command-line interface (CLI) tool designed to enhance the functionality of AWS Vault, enabling seamless switching between AWS profiles without the need to exit the current shell session.

It simplifies the process of managing multiple AWS accounts by listing all AWS profiles managed by AWS Vault and switching between them. It helps maintain the working context and improves efficiency.

Installing

You can install aws-vault-switch by downloading the latest release;

  • on macOS, download the package and move it to /usr/local/bin.

      $ wget https://github.com/kobeBigs/aws-vault-switch/releases/download/v0.1.0/aws-vault-switch-mac.tar.gz 
      $ tar -xzvf aws-vault-switch-mac.tar.gz 
      $ sudo mv aws-vault-switch-mac /usr/local/bin/aws-vault-switch
    

if you are on macOS arm64 architecture you can download the arm package and use the instructions above

Also, you can clone and build from source.

$ git clone https://github.com/kobebigs/aws-vault-switch
$ cd aws-vault-switch
$ go build -o aws-vault-switch

How to use it

# run aws-vault-switch and navigate and select using the arrow keys and enter key respectively
$ aws-vault-switch
Use the arrow keys to navigate: ↓ ↑ → ←
? Select AWS Profile:
  ▸ default
    aws-account-dev
    aws-account-prod
    aws-account-marketing
↓   aws-account-sales

Note: make sure you have AWS Vault installed and setup before using aws-vault-switch.

Contributions: issues, forks, and pull requests are welcome!