aws-vault
aws-vault copied to clipboard
Support custom env variables
Looking to see if there's any interest in support custom environment variables, i.e. FOO=bar
Primary use is for TF_VAR_foo
. There's a few terraform providers (i.e. Github, etc.) that use user-scoped keys instead of globally scoped keys (global keys could be used in kms
with chamber
or another shared keystore, but the user-scoped keys should probably be kept locally)
is there any interest in a feature like this if a pr is made or is aws-vault
soley going to focus on aws
creds (completely valid as well)? also, thanks for all the great work!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
News?
Any update on this?
As a workaround (and if you're using fish), you can set an environment variable based on the name of the profile while invoking aws-vault exec
. Simply create a file ~/.config/fish/functions/aws-vault.fish
with the following content, and you're done:
function aws-vault --wraps aws-vault --description 'alias aws-vault=aws-vault'
set --local argv_nooptions (string match --invert -- '-*' $argv)
if set --query argv_nooptions[2]; and [ $argv_nooptions[1] = exec ]
set --local profile $argv_nooptions[2]
set --export KUBECONFIG $HOME/.kube/config-$profile
end
command aws-vault $argv
end
Here the name of the profile gets appended to the name of the kubectl config file, so you don't have to update the kubectl config each time a different aws-vault profile is used.