This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-06
Channels
- # announcements (2)
- # architecture (2)
- # aws (18)
- # babashka (7)
- # beginners (149)
- # bristol-clojurians (4)
- # calva (11)
- # chlorine-clover (1)
- # cider (8)
- # clj-kondo (2)
- # cljdoc (2)
- # cljsrn (2)
- # clojure (186)
- # clojure-canada (3)
- # clojure-europe (3)
- # clojure-gamedev (5)
- # clojure-italy (1)
- # clojure-nl (13)
- # clojure-norway (4)
- # clojure-spec (25)
- # clojure-uk (32)
- # clojurescript (75)
- # core-async (2)
- # cursive (16)
- # data-science (3)
- # datomic (20)
- # docker (1)
- # emacs (26)
- # fulcro (7)
- # graphql (1)
- # incanter (1)
- # leiningen (1)
- # luminus (7)
- # malli (7)
- # mount (11)
- # off-topic (19)
- # pathom (15)
- # re-frame (9)
- # reagent (9)
- # remote-jobs (4)
- # ring-swagger (4)
- # shadow-cljs (63)
- # spacemacs (11)
- # sql (2)
- # vscode (7)
Is cognitect.aws.client
supposed to work with other S3 providers than amazon? I’m trying to connect to a NetApp StorageGRID S3 endpoint but don’t know how.
(aws/client {:api :s3
:endpoint-override {:hostname ""}})
gives me an error:
Execution error (ExceptionInfo) at cognitect.aws.client.api/client (api.clj:94).
No known endpoint.
;; Mock S3 Service ;; https://github.com/adobe/S3Mock ;; https://github.com/adobe/S3Mock/blob/master/server/src/main/java/com/adobe/testing/s3mock/S3MockApplication.java (def props {S3MockApplication/PROP_HTTPS_PORT S3MockApplication/RANDOM_PORT S3MockApplication/PROP_HTTP_PORT S3MockApplication/RANDOM_PORT S3MockApplication/PROP_INITIAL_BUCKETS bucket S3MockApplication/PROP_SILENT “true” }) (def s3mock (S3MockApplication/start (HashMap. props) (into-array String []))) (def s3 (aws-api/client {:api :s3 :endpoint-override {:protocol :http :hostname “localhost” :port (.getHttpPort s3mock)}}))
Haven not yet looked into what S3MockApplication
really does but for me :endpoint-override
seems not to work.
aws-api's interactions with aws are based on data descriptions of their apis: (https://github.com/aws/aws-sdk-js/tree/master/apis)
AWS does not make any promises about those descriptions aligning with specs that other vendors use to make s3-compatible services, so neither can we.
Actually, looking at the error you posted above, "no known endpoint", that comes from aws-api even before trying to send a request out.
OK, so the answer to your original question is that no, aws api does not promise to work with endpoints outside of aws. Please feel free to submit an issue https://github.com/cognitect-labs/aws-api/issues and we can continue the convo there.
When supplying a valid :region
I manged to connect to a NetApp StorageGRID S3 endpoint.
(def s3 (aws/client {:api :s3
:region "us-west-1"
:endpoint-override {:protocol :https
:hostname ""}
:credentials-provider (credentials/basic-credentials-provider
{:access-key-id ACCESS_KEY
:secret-access-key SECRET_KEY})}))
(aws/invoke s3 {:op :ListBuckets})
withou :region
the aws/client
runs for a while an than failes with an error:
Execution error (ExceptionInfo) at cognitect.aws.region$chain_region_provider$reify__13062/fetch (region.clj:37).
No region found by any region provider.
with :region "foo"
the error is a little misleading:
Execution error (ExceptionInfo) at cognitect.aws.client.api/client (api.clj:94).
No known endpoint.
… but with :region "eu-central-1"
the client is created and (aws/invoke s3 {:op :ListBuckets})
successfully delivers the expected results
Did you have a region configured in your environment? https://github.com/cognitect-labs/aws-api#region-lookup https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-region-selection.html
Ah https://github.com/cognitect-labs/aws-api/issues/5. Anyone have a workaround for now?