donnemartin / saws

A supercharged AWS command line interface (CLI).
Other
5.24k stars 281 forks source link

SAWS Caching credentials? Leading to conflict. #62

Open zapman449 opened 8 years ago

zapman449 commented 8 years ago

When I set shell variables AWS_SECRET_ACCESS_ID and AWS_ACCESS_KEY_ID, and within SAWS run a command like:

aws s3 ls s3://

The command works

However, tab-completion is attempting to work against a DIFFERENT account, which is confusing as heck.

Does SAWS cache a credential or token somewhere if you run "aws configure"?

I don't see anything interesting in .saws-history or .saws.log or .sawsrc

-Jason

donnemartin commented 8 years ago

@zapman449 have you tried setting AWS_DEFAULT_PROFILE?

AWS Credentials and Named Profiles

If you'd like to use a specific named profile with SAWS, run the following commands on OS X, Linux, or Unix:

$ export AWS_DEFAULT_PROFILE=user1
$ saws

Or as a one-liner:

$ AWS_DEFAULT_PROFILE=user1 saws
zapman449 commented 8 years ago

I have not. Due to other aspects of our tooling, I'm hoping that SAWS can use the same auth mechanisms that AWSCLI can... The AWSCLI documentation says that the Shell Variables trump any config files.

Further, it's still very odd that SAWS is able to tab complete something that's not in the account that the internal AWS command will use

Example: Account A s3 buckets: tools-saw tools-drill tools-router

Account B s3 buckets: tools-trimmer tools-clipper tools-mower

AWS variables set to Account A SAWS previously saw Account B

saws aws s3 ls s3://tools-

List will show: tools-trimmer tools-clipper tools-mower

But 'aws s3 ls' will only work with account A's buckets.

-Jason

donnemartin commented 8 years ago

@zapman449 it does seem like the there's an issue with SAWS and profiles, which seems to also be the discussion in https://github.com/donnemartin/saws/issues/16. The method described above hopefully is a workaround to you up and running until the bug is fixed.

I appreciate the detailed info, it should help investigating and fixing the root cause.