Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

~/.aws/credentials parsing, session layer ? #109

Open
dynnamitt opened this issue Jan 2, 2022 · 5 comments
Open

~/.aws/credentials parsing, session layer ? #109

dynnamitt opened this issue Jan 2, 2022 · 5 comments

Comments

@dynnamitt
Copy link

dynnamitt commented Jan 2, 2022

Is a layer planned for implementing some of this:
https://docs.aws.amazon.com/sdk-for-go/api/aws/session/

~/.aws/credentials parsing to avoid duplicate config-files for aws-cli and this lib ?

load order:

* Environment Variables (edit: supported in Client.create/0 and Client.create/1 )
* Shared Credentials file
* Shared Configuration file
@philss
Copy link
Contributor

philss commented Jan 3, 2022

@dynnamitt Interesting. I didn't know about this config file. Please go ahead if you to submit a PR :)

@jadeallenx
Copy link

That's literally why this library exists.

@dynnamitt
Copy link
Author

dynnamitt commented Jan 5, 2022

That's literally why this library exists.

"aws_credentials" would solve some parts of it yes, but (there is always a but):

  1. no ~/.aws/config provider
    profiles here can trigger new sts "credential request" via either:
    - mfa_serial (tricky interactive stuff)
    - assume-role (role_arn)
    - sso
  2. no hex.pm publishing

I'm just learning Elixir ... writing a config provider in Erlang isn't an option for me

I'll see what I can cook up (in elixir) , on a path of reading other SDKs currently

@pranavraja
Copy link
Contributor

I've run into the need to parse ~/.aws/credentials files as well, including assuming roles via the source_profile property, and usually end up writing a helper function like in https://gist.github.com/pranavraja/f3585456d02216eba40dfc2605570935

@aleDsz
Copy link

aleDsz commented Jul 4, 2022

@dynnamitt I'll open a PR based on your project (dynnamitt/ex_aws_cconf#1) to aws_credentials, which already support multiple profiles, but only via application env/erlang env. This is debatable on how this application should handle these configurations, but we should be able to read the sabe profile for both files.

The code is here: https://github.com/aleDsz/aws_credentials/tree/ale-support-aws-config-file

I'm probably missing something from ~/.aws/config file, but I'll be reading more about and updating my code. Some feedback would be awesome ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants