Fork me on GitHub

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 '[ :refer [CredentialsProvider]]
         '[ :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?


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

Alex Miller (Clojure team)13:12:51

Yes, can definitely do it yourself like that

Alex Miller (Clojure team)13:12:26

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

Alex Miller (Clojure team)13:12:43

Please file a github issue on the api...


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

Alex Miller (Clojure team)14:12:53

I think the priority was to match the Java SDK first