aws-beam/aws-elixir

~/.aws/credentials parsing, session layer ?

Opened this issue ยท 5 comments

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

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

That's literally why this library exists.

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

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

@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 โค๏ธ