- Set up the folder
~/.awsenv/
with the folder structure shown below - Create a
credentials.txt
for every environment folder (see an example below) - Ensure no other user than yourself can view those files
- Create the function
set_aws
in~/.config/fish/functions/set_aws.fish
(see an example below) - Now load any environment using
set_aws <environment>
likeset_aws private
luzifer@knut-workstation01 ~> tree .awsenv/
.awsenv/
├── clear
│ └── credentials.txt
├── company
│ └── credentials.txt
├── private
│ └── credentials.txt
└── setup.fish
3 directories, 4 files
luzifer@knut-workstation01 ~>
Just because I'm using fish as my daily shell and want to continue to use it. But I'm quite sure you don't need much time to re-create this for other shells like zsh
or bash
too.
I wrote a general purpose fish plugin for this a while back: https://github.com/joehillen/ev-fish