Fork me on GitHub
#aws
<
2018-12-05
>
chrisulloa05:12:21

Question about the cognitect-labs/aws-api, if I want to pass in a set of credentials (rather than setting env variables), doing something like this works:

(require '[cognitect.aws.credentials :refer [CredentialsProvider]]
         '[cognitect.aws.api :as aws])

(defn credentials-provider
  [access-key secret-key]
  (reify CredentialsProvider
    (fetch [_]
      {:aws/access-key-id access-key
       :aws/secret-access-key secret-key})))

(def s3-client (aws/client {:api :s3 :region "us-east-1"
                            :credentials (credentials-provider access-key secret-key)}))
But is there any reason why it doesn’t allow us to just pass in a map with the credentials?

dottedmag07:12:32

@christian.gonzalez Probably because nobody got around to implement CredentialsProvider via map. But you can do it yourself if you need, can't you?

alexmiller13:12:51

Yes, can definitely do it yourself like that

alexmiller13:12:26

Might be reasonable to have this in the api though - I’ve already written this code too

alexmiller13:12:43

Please file a github issue on the api...

chrisulloa13:12:26

Yeah I’ll file an issue thanks guys! I wasn’t sure if there was reasoning behind it.

alexmiller14:12:53

I think the priority was to match the Java SDK first