This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-05
Channels
- # admin-announcements (183)
- # aws (30)
- # beginners (22)
- # boot (301)
- # cider (19)
- # cljs-dev (3)
- # cljsrn (23)
- # clojars (15)
- # clojure (136)
- # clojure-italy (8)
- # clojure-nl (4)
- # clojure-russia (19)
- # clojured (10)
- # clojurescript (134)
- # component (48)
- # cursive (7)
- # datavis (4)
- # datomic (50)
- # devcards (6)
- # events (9)
- # jobs (1)
- # ldnclj (10)
- # lein-figwheel (19)
- # leiningen (1)
- # luminus (16)
- # off-topic (5)
- # om (151)
- # proton (60)
- # re-frame (10)
- # reagent (25)
- # remote-jobs (1)
- # slack-help (3)
- # spacemacs (1)
- # vim (1)
excellent! looks like it will fit the bill nicely! Otherwise I was slowly leaning towards writing a couple Lambda functions in python.
oh.. .hm... it doesn’t look like eulalie handles S3 yet. Might be possible to tack on.
my plan is cljs on the browser that generates a chunk of edn and dumps it into S3. Going thru API Gateway and a Lambda seems like it avoids the ugly S3 signed policy stuff.
(and I still can't find any docs or examples on putting file contents instead of a file name into the S3 POST.)
hi, anyone could get .createClient working with java-interop? every lib i’ve found so far they using .setRegion after the client got created i tried so far:
(def creds (BasicAWSCredentials. aws-access-key-id aws-secret-access-key))
(def region (-> "AP_SOUTHEAST_1" Regions/valueOf Region/getRegion))
(def cfn (.createClient region AmazonCloudFormationClient. creds))
and some trial and error with different versions of passing AmazonCloudFormationClient/class
http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-region-selection.html#id2
looks like maybe you can do (.. (AmazonCloudFormationClient. creds) (withRegion (Regions/fromName "AP_SOUTHEAST_1")))
the ..
is a good match for the withX
"fluent" stuff all over amazon sdks
cool thanks, good to know
also clojures immutable data structures are also applied to java objects created via java interop in clojure? so the race condition documented about .setRegion afterwards shouldnt be a problem when running from clojure?
that's not what i undertsand
seems more to be advice not to setRegion on an existing client
instead creating a new client for that region
so they're saying, don't create the client and start doing work with it, and then set the region
ah ok thanks for clarification 😉
i somehow missed the last part of the sentence :/ before any service requests are made
it's ok
so many reams of docs with AWS it's easy to miss things 📚
out of curiosity how would this translate to clojure interop?
AmazonEC2 ec2 = Region.getRegion(Regions.US_WEST_2).createClient(
AmazonEC2Client.class, credentials, clientConfig);
the AmazonEC2Client.class
is kind irritating (i have 0 java background)(import
com.amazonaws.regions.Region
com.amazonaws.regions.Regions
com.amazonaws.services.ec2.AmazonEC2Client)
(.createClient (Region/getRegion Regions/US_WEST_2) AmazonEC2Client credentials clientConfig)
wherever you see .class
in Java you can just use the class name symbol in clj
in clj symbols that resolve to known classes resolve to the class value
e.g. AmazonEC2Client.class == AmazonEC2Client in clj
also in that code i'm using /
both to call a static method getRegion
and to get a static field US_WEST_2
.createClient
is an instance method call to the object returned by (Region/getRegion ...)
got it, thanks!!
cheers - i'm off, see you later