aws-vault
aws-vault copied to clipboard
AWS-Vault clear does not clear `AWS_VAULT` environmental variable
- [ x] I am using the latest release of AWS Vault
- [N] I have provided my
.aws/config
(redacted if necessary) - [N] I have provided the debug output using
aws-vault --debug
(redacted if necessary)
Running aws-vault clear
does not clear out the AWS_VAULT
environmental variable.
Steps to reproduce:
- Run
aws-vault exec <PROFILE> --ecs-server
- Run
echo $AWS_VAULT
to see<PROFILE>
- Run
aws-vault clear
- Run
echo $AWS_VAULT
(<PROFILE>
is still set) - Validate profile is still set by running
aws-vault exec <PROFILE> --ecs-server
- Still get warning:
aws-vault: error: exec: aws-vault sessions should be nested with care, unset AWS_VAULT to force
Recommend adding to the clear function:
if os.Getenv("AWS_VAULT") != "" {
err = os.Unsetenv("AWS_VAULT")
if err != nil {
return fmt.Errorf("Unable to unset environmental variable: 'AWS_VAULT'")
}
}