99designs / aws-vault

A vault for securely storing and accessing AWS credentials in development environments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use environment variables within CMD

mxmauro opened this issue · comments

  • I am using the latest release of AWS Vault
  • I have provided my .aws/config (redacted if necessary)
  • 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.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.