Fork me on GitHub
Nick Stares22:01:31

Hi! First time using aws-api and I I am trying to invoke a Basically the equivalent of hitting

With a GET or POST request. How should I go about doing this? I took a shot in the dark but I don't know what the value for :api should be:
(aws/client {:api :apigateway
               :region "us-east-1"
               :endpoint-override {:hostname "ry8g3pqgz5"
                                   :path     "/prod/workflows"}}))
I'll also need to supply a session token. If I am able to build the client successfully, what would the Invoke :op be? I would have used an http client but then I think I would have to implement the signature calculations for the authorization header from scratch[??]


The url you want to reach looks similar to the websocket example with :PostToConnection, that might work for your use-case, see:

Nick Stares18:02:36

Hmm, I tried this but it didn't work

(def amc
  (aws/client {:api :apigatewaymanagementapi
               :region "us-east-1"
               :endpoint-override {:hostname "ry8g3pqgz4"
                                   :path     "/prod/workflows"}
               :credentials-provider (credentials/basic-credentials-provider
                                            {:access-key-id     (:AccessKeyId creds)
                                             :secret-access-key (:SecretAccessKey creds)
                                             :session-token     (:SessionToken creds)})}))

(aws/invoke amc {:op :PostToConnection})
;; => {:cognitect.anomalies/category :cognitect.anomalies/not-found, :cognitect.anomalies/message "ry8g3pqgz4: nodename nor servname provided, or not known"}

Nick Stares18:02:28

Also, not sure what operation I would use for GET  since I assume :PostToConnection is only for`POST`