This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-28
Channels
- # admin-announcements (72)
- # aws (23)
- # beginners (43)
- # boot (140)
- # cider (11)
- # cljs-dev (4)
- # cljsrn (82)
- # clojars (2)
- # clojure (215)
- # clojure-nl (2)
- # clojure-russia (149)
- # clojurecup (4)
- # clojurescript (159)
- # cursive (19)
- # datomic (47)
- # editors (1)
- # emacs (27)
- # hoplon (32)
- # jobs (11)
- # ldnclj (3)
- # mount (33)
- # off-topic (1)
- # om (380)
- # onyx (1)
- # re-frame (2)
- # reagent (54)
- # yada (63)
@clojuregeek: have you dipped into java at all? looks like this method on AmazonS3Client does the thing - http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Client.html#getBucketTaggingConfiguration(java.lang.String)
(perhaps amazonica isn't configured to generate proxy functions for the tag-related methods for some reason?)
@alandipert: i do have a method get-bucket-tagging-configuration
when i do (dir amazonica.aws.s3)
I can't figure out how i need to call it though
i think maybe with the string name of the bucket, according to javadoc
another overload takes some configuration map
dev> (s3/get-bucket-tagging-configuration creds {:bucket "mybucket"})
IllegalArgumentException The bucket name must be specified when retrieving the bucket tagging configuration. com.amazonaws.services.s3.\
AmazonS3Client.rejectNull (AmazonS3Client.java:2847)
try (s3/get-bucket-tagging-configuration creds "mybucket")
that gives me
IllegalArgumentException wrong number of arguments sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
ok last guess
(s3/get-bucket-tagging-configuration creds {:bucket-name "mybucket"})
(based on methods on http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/GetBucketTaggingConfigurationRequest.html)
no 😞
maybe call the java things directly?
i find myself doing this now most of the time, for reasons like this
(def emr
(if (resolve 'boot.core/*boot-version*)
;; If we're in boot, we're running locally
(let [creds (com.amazonaws.auth.BasicAWSCredentials.
(System/getenv "ADZERK_AWS_ACCESS_KEY")
(System/getenv "ADZERK_AWS_SECRET_KEY"))]
(AmazonElasticMapReduceClient. creds))
;; In Lambda, credentials come from role
(AmazonElasticMapReduceClient.)))
if you sub for AmazonS3Client there you'll have yourself a working client, just tweak the ADZERK_* creds for whatever you use
when you have a credentialed AmazonS3Client you can call getBucketTaggingConfiguration
on it with the bucket name as string
ok thanks for your help, i'll see if I can access the java directly. If I can figure it out, i'll write a blog post
@clojuregeek: np! here is a self-contained script that gets the tags for a bucket - https://gist.github.com/alandipert/39c65618ecc716e38210
thanks!
no problem, see you later