kreuzwerker / awsu

Enhanced account switching for AWS, supports Yubikey as MFA source
GNU General Public License v3.0
175 stars 16 forks source link

Inconsistent profile lookup in ~/.aws/config #36

Open janborch opened 5 years ago

janborch commented 5 years ago

Found two inconsistencies in loading the the AWS CLI configufration from ~/.aws/config file.

Problem 1:

The default location for the AWS CLI config file is ~/.aws/credentials but should be ~/.aws/config

> awsu –help

…
-c, --config-file string               sets the config file (default "/Users/borchj/.aws/credentials")

I fixed the problem by adding parameter -c ~/.aws/config but it's a bit cumbersome to add this to each invocation.

Problem 2:

According to the AWS doc https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html, profiles in the config file should be prefixes by profile. For example:

[profile user1]
region=us-east-1

awsu returns an error message : no such profile "user1" configured

awsu find the profile if you remove the ‘profile’ prefix.

[user1]
region=us-east-1
yawn commented 5 years ago

Thanks for the bugreport @janborch - I'll look into it!

yawn commented 5 years ago

Currently awsu actually treats both locations as one and the same since for historical reasons they were just symlinked to one file (on my machine). I'll fix it in the release after this one (for Catalina).

yawn commented 4 years ago

Sorry for the late response / reaction. Please also see the discussion here https://github.com/kreuzwerker/awsu/pull/45#issuecomment-599235037 and please give me some feedback.