aws-vault icon indicating copy to clipboard operation
aws-vault copied to clipboard

Unable to use environment variables within CMD

Open mxmauro opened this issue 1 year ago • 0 comments

  • [X] I am using the latest release of AWS Vault
  • [X] I have provided my .aws/config (redacted if necessary)
  • [X] I have provided the debug output using aws-vault --debug (redacted if necessary)

Hi, I'm creating a Windows batch file in order to make web login more friendly.

In my script I use:

aws-vault add --env mauro
aws-vault login --region=us-east-2 mauro

But end receiving:

2022/09/09 18:51:25 aws-vault v6.6.0
2022/09/09 18:51:25 [keyring] Considering backends: [wincred]
2022/09/09 18:51:25 Loading config file C:\Users\Bubble\.aws\config
2022/09/09 18:51:25 Parsing config file C:\Users\Bubble\.aws\config
Added credentials to profile "mauro" in vault
2022/09/09 18:51:25 aws-vault v6.6.0
2022/09/09 18:51:25 [keyring] Considering backends: [wincred]
2022/09/09 18:51:25 Loading config file C:\Users\Bubble\.aws\config
2022/09/09 18:51:25 Parsing config file C:\Users\Bubble\.aws\config
2022/09/09 18:51:25 Profile 'default' missing in config file
2022/09/09 18:51:25 Looking up keyring for 'mauro'
aws-vault: error: login: profile mauro: operation error IAM: GetUser, https response error StatusCode: 403, RequestID: {xxxx}, api error InvalidClientTokenId: The security token included in the request is invalid.

Content of .aws/config:

[profile mauro]

If I ECHO the values of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables and remove the --env parameter so I copy/paste the values, it works.

For some reason, using --env does not takes the path that displays Using GetFederationToken for credentials

Kind regards, Mauro.

mxmauro avatar Sep 09 '22 22:09 mxmauro