This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (4)
- # aws (24)
- # babashka (118)
- # babashka-sci-dev (18)
- # beginners (56)
- # calva (2)
- # clojure (54)
- # clojure-dev (8)
- # clojure-europe (25)
- # clojure-gamedev (5)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (2)
- # conjure (1)
- # core-async (1)
- # data-science (3)
- # datomic (5)
- # emacs (8)
- # fulcro (4)
- # hyperfiddle (12)
- # interop (1)
- # jackdaw (4)
- # lsp (5)
- # mid-cities-meetup (5)
- # nbb (32)
- # off-topic (21)
- # reitit (2)
- # shadow-cljs (12)
- # sql (8)
- # vim (18)
- # xtdb (9)
Hi there, I'm trying to use the java aws sdk to initialize a
SecretsManagerClient following along with examples I found online this is the code I expect to work
But I get the following error
(-> (SecretsManagerClient/builder) (.region (Region/of "us-west-2")) .build)
However, if I import the class at the repl, calling
Execution error (IllegalArgumentException) at user/eval18745 (form-init12695352935497667069.clj:1). No matching method of found taking 1 args for class java.lang.Class
does indeed work correctly. Does anyone have experience with something like this? EDIT: here is another more clear error message that I also got:
No matching method of found taking 1 args for class com.amazonaws.regions.Region
My guess is when you "import the class at the repl" you are importing a different class
Ohhhh, indeed. In my code it is imported as
Whereas at the repl I imported
The latter doesn't work in my namespace though... Even though I guess I don't really understand what is going on, I think I did sort out that I can get the region like this...
Thank you for the tip @hiredman!
(-> (SecretsManagerClient/builder) (.region (Region/getRegion Regions/US_WEST_2)) .build)
Oh gosh, maybe not.
class com.amazonaws.regions.Region cannot be cast to class software.amazon.awssdk.regions.Region (com.amazonaws.regions.Region and software.amazon.awssdk.regions.Region are in unnamed module of loader 'app')
I must've had a typo, I just deleted everything and very carefully added it back in. Thank you for the
Does anybody have experience with redshift and sorting the data correctly, so queries stay fast? General RDB advice is welcome
advice specific to redshift or in general? In general the only way something can traverse something fast is if it's close together. As in, you have to store things in the sorted order. In database speak, that's indexing. space for time.
In cloudformation, when your spinning up resources, if one requires the ARN of another how do you handle that? like, how do they do references?
i'll figure it out from here i'm sure, but this example is funny because it has a ref but not the important bit where it shows the other end of the edge.
MyEIP: Type: "AWS::EC2::EIP" Properties: InstanceId: !Ref MyEC2Instance # <--- where is this declared?
Depending on the resource type, it may or may not return what you need for the other resource parameter. Sometimes you'll need to use
Fn::GetAtt instead. I find i consult this a lot
The Ref argument refers to either the name you give the resource (ie, names on the level of MyEIP in that example, MyEC2Instance would be a sibling ), or the name of a parameter of your template. (and maybe some more stuff I'm forgetting)
Haha yup it definitely feels like coding in json a bit, wait til you get to if statements/conditionals
I've been on an ongoing deep dive in to cloudformation. Overall I like it, after getting comfortable with the ways to do things. In the end I like that it's just JSON and it's nice that you can just stick some edn in a clojure file and break it up and add as many helpers as you want before calling some json library to write it out as json.
I'm certainly glad it's an option! I wonder if there are any clojure wrappers that do some really fun runtime analysis to try and help you intelligent build and update cloudformation though. You could pull the api and return suggestions in the editor. etc... I know you can output CF from the design tool, but it doesn't seem to actually help you with anything other then putting pictures together. which is odd... Is "taskdefination" the name of the instance of this task below?
taskdefinition: Type: AWS::ECS::TaskDefinition
There are a few attempts at tooling in clojure ie https://github.com/brabster/crucible, but I don' think it has that many resource types supported and isn't actively being updated
the specification for everything is here though so it shouldn't be too hard to get an auto-complete thing going https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html