awsu icon indicating copy to clipboard operation
awsu copied to clipboard

Inconsistent profile lookup in ~/.aws/config

Open janborch opened this issue 5 years ago • 3 comments

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

janborch avatar May 08 '19 08:05 janborch

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

yawn avatar May 08 '19 11:05 yawn

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 avatar Oct 15 '19 07:10 yawn

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.

yawn avatar Mar 15 '20 17:03 yawn