Fork me on GitHub
#aws
<
2020-12-07
>
dabrazhe13:12:32

Hi. Does anyone have an example or can explain how to work with ClientBuilders in AWS SDK in Clojure? I am can create a builder (AmazonKinesisVideoClient/builder) but when trying to (.build) it, I am getting all sorts of errors, eg - call to method withRegion can't be resolved (target class is unknown).

ghadi14:12:38

@dennisa paste your code

ghadi14:12:09

BTW Have you tried the Cognitect Labs aws client? Much more native feel

dabrazhe20:12:33

It's along the lines of

(doto (AmazonKinesisVideoClientBuilder/standard)
  (.withRegion region-const)
  (.withCredentials credential-provider)
....
  (.build))

dabrazhe20:12:51

I haven't tried the cognitect aws client yet. It's more an API caller. It felt calling the Java SDK from Clojure would be more native : )

Alex Miller (Clojure team)20:12:01

using the java sdk means making function calls to generate a bunch of objects which get turned into a bunch of http calls. the cognitect aws api is a functional api to make those http calls without all the junk in the middle

dabrazhe21:12:45

Isn't processing java objects returned by the SDK easier than parsing the output of the https calls ? : )

Alex Miller (Clojure team)21:12:34

no, it's all autogenerated

Alex Miller (Clojure team)21:12:59

amazon publishes data files describing the apis

Alex Miller (Clojure team)21:12:10

also has autogenerated docs and clojure specs

dabrazhe22:12:08

Thank you, will have a look. I guess the cognitect aws client is similar to aws-cli in a way? Does the api it return the native Clojure data stuctures ? : )

ghadi22:12:43

takes data, returns data

☑️ 3