jaxxstorm / aws-sso-creds

Get AWS SSO temporary creds from an SSO profile
MIT License
186 stars 24 forks source link

Error when .credentials file is missing #41

Closed bromanko closed 6 months ago

bromanko commented 1 year ago

I tried to run aws-sso-creds set foo-temp -p foo on a new machine with fresh awscli install. I got the following error:

/Users/bromanko/.aws/credentials
/Users/bromanko/.aws/config
Error: error parsing config file: open /Users/bromanko/.aws/credentials: no such file or directory

Fixed with touch ~/.aws/credentials.

Seems it would be better to detect when this file is missing and either create it or exit with an error message such as "Error storing credentials in /Users/bromanko/.aws/credentials. The file does not exist."

jaxxstorm commented 1 year ago

@bromanko is there something about the error message that would be improved by the tool throwing a different message?

it seems to me based on the error, you knew the solution. I think this is as designed.

bromanko commented 1 year ago

I only sorted it out because I looked at the source code. Nothing about what I was doing made it clear that file should exist. I suggest this would be clearer. “Error storing credentials in /Users/bromanko/.aws/credentials. The file does not exist. Please create it. "

jaxxstorm commented 6 months ago

Closing as by design, this tool's job is to retrieve AWS temporary credentials, not guide you through AWS credentials set up