This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-31
Channels
- # announcements (1)
- # aws (4)
- # babashka (40)
- # beginners (89)
- # calva (13)
- # cider (3)
- # clj-kondo (36)
- # cljdoc (16)
- # clojure (74)
- # clojure-boston (1)
- # clojure-dev (7)
- # clojure-europe (30)
- # clojure-new-zealand (1)
- # clojure-nl (17)
- # clojure-uk (5)
- # clojurescript (16)
- # core-async (9)
- # cursive (16)
- # datahike (3)
- # datalog (6)
- # datascript (7)
- # datomic (15)
- # emacs (38)
- # events (2)
- # figwheel-main (3)
- # fulcro (6)
- # google-cloud (18)
- # graalvm (6)
- # gratitude (1)
- # honeysql (1)
- # introduce-yourself (1)
- # jobs (1)
- # leiningen (5)
- # lsp (6)
- # malli (11)
- # meander (2)
- # off-topic (4)
- # re-frame (6)
- # reitit (8)
- # releases (2)
- # remote-jobs (3)
- # reveal (4)
- # shadow-cljs (200)
- # sql (8)
- # tools-deps (16)
Hi! First time using aws-api
and I I am trying to invoke a https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-private-api-test-invoke-url.html. Basically the equivalent of hitting
https://{restapi-id}.execute-api.{region}.
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: https://github.com/cognitect-labs/aws-api#posttoconnection
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"}
Also, not sure what operation I would use for GET
since I assume :PostToConnection
is only for`POST`