https://www.tastycidr.net/using-aws-vault-with-linux/
https://github.com/FernandoMiguel/aws-vault-quick-guide
curl -Lo aws-vault https://github.com/99designs/aws-vault/releases/download/v4.2.1/aws-vault-linux-amd64 && chmod +x aws-vault && sudo cp aws-vault /usr/bin/aws-vault
export AWS_VAULT_BACKEND=file
Make sure each profile has the mfa_serial
line
- In the
config
file, add[{profile name}]
. - In the terminal run
aws-vault --backend=file add {profile name}
- Add profile credentials as prompted inthe terminal
aws-vault --backend=file list
aws-vault --backend=file remove {profile-name} --sessions-only
aws-vault --backend=file exec {profile-name} -- npm run deploy
aws-vault --backend=file exec {profile-name} -- aws ec2 describe-instances
aws-sdk will pick up on credentials from ~/.aws/credentials, so use `export AWS_PROFILE='{profile-name}'