broamski / aws-mfa

Manage AWS MFA Security Credentials
MIT License
1.01k stars 163 forks source link

aws-mfa hitting to "https://sts.amazonaws.com/" instead of "https://sts.<region>.amazonaws.com/" #80

Open Ankits19 opened 1 year ago

Ankits19 commented 1 year ago

I am using aws-mfa.

When i run aws-mfa with profile name with long-term credentials in my ~/.aws/credentials, it is always reaching to https://sts.amazonaws.com as my machine is in private network so not able to resolve it and failing to have temporary creds in my file.

image

DanielMcAssey commented 1 year ago

You have to create an environment variable with the following: AWS_STS_REGIONAL_ENDPOINTS='regional'

Ankits19 commented 1 year ago

Hi, even after adding this it is still going to the global endpoint instead of REGIONAL. If i remember correctly I tried this earlier as well.

image
Ankits19 commented 1 year ago

Adding "sts_regional_endpoints = regional" in ~/.aws/config file, worked but will it should not be created by aws-mfa? because what we create profile is default-long-term.

image