Fork me on GitHub
#aws
<
2019-02-19
>
lispers-anonymous14:02:25

I asked this question on zulip the other day and wasn’t able to get very far: https://clojurians.zulipchat.com/#narrow/stream/151168-clojure/topic/cognitect.20aws.20api/near/158088908 I’m going to try my luck reposting it here: I’m trying to see if the cognitect’s aws api will fit my needs as a dynamoDB client. I’d like to be able to run dynamoDB locally with https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html But I can’t figure out how to connect to my local instance with the clojure client. There is an option to pass in an endpoint override, but it doesn’t like it when I specify the port for my local instance like so

(def ddb (aws/client {:api :dynamodb
                      :endpoint-override "localhost:8000"
                      :credentials-provider #_blahblahblah }))
Which will give me this error, obviously trying to tack in the port that I guess is provided by the AWS API spec
{ :cognitect.anomalies/category :cognitect.anomalies/fault, :cognitect.anomalies/message "Malformed IPv6 address at index 8: http://[localhost:3000]:443", :cognitect.http-client/throwable java.lang.IllegalArgumentException: Malformed IPv6 address at index 8: http://[localhost:3000]:443, :body  }
Trying without the port like so :endpoint-override "localhost" and running the local dynamoDB (via docker) configured to listen on port 443 gives me an SSL exception
{ :cognitect.anomalies/category :cognitect.anomalies/fault, :cognitect.anomalies/message "Unrecognized SSL message, plaintext connection?", :cognitect.http-client/throwable javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?, :body  }
Has anyone here had any luck getting something like this to work, even on a different aws service? I’ve tried all the values I can for endpoint-override and none of them will work. I have a feeling that this isn’t what the override is intended for.

Alex Miller (Clojure team)14:02:53

I can't answer your question, but posting an issue at https://github.com/cognitect-labs/aws-api/issues is where the aws-api maintainers work from

ghadi14:02:20

@dannyfreeman seems like DDB local doesn't use SSL, right?

ghadi15:02:55

the error you received indicates that aws-api is connecting to a plaintext http port and attempting to negotiate a TLS handshake

ghadi15:02:39

I don't think the endpoint override functionality in aws-api can do plain http

lispers-anonymous15:02:10

Sounds like I need to go the route that @alexmiller suggested and post an issue on github to see if I can find a way to override that as well

ghadi15:02:18

yes please -- there isn't a hook for it

sheepy 5
💯 5
👍 5
lispers-anonymous15:02:50

Thanks guys. I’ll work on that later today