Fork me on GitHub

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

(-> (SecretsManagerClient/builder)
                   (.region (Region/of "us-west-2"))
But I get the following error
Execution error (IllegalArgumentException) at user/eval18745 (form-init12695352935497667069.clj:1).
No matching method of found taking 1 args for class java.lang.Class
However, if I import the class at the repl, calling
(Region/of "us-west-2")
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

( Region)
Whereas at the repl I imported
( Region)
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...
(-> (SecretsManagerClient/builder)
                   (.region (Region/getRegion Regions/US_WEST_2))
Thank you for the tip @hiredman!


Oh gosh, maybe not.

class com.amazonaws.regions.Region cannot be cast to class (com.amazonaws.regions.Region and 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 duckie


Does anybody have experience with redshift and sorting the data correctly, so queries stay fast? General RDB advice is welcome

Drew Verlee22:07:38

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.

👍 1
Drew Verlee22:07:39

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?

Drew Verlee22:07:47

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.

  Type: "AWS::EC2::EIP"
    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)

Drew Verlee22:07:34

This is how cloudformation makes me feel on the inside.

😆 1

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.

Drew Verlee22:07:40

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?

  Type: AWS::ECS::TaskDefinition


{:Resources {"<your names>" {:Type "" :Properties {...}} ...}


There are a few attempts at tooling in clojure ie, 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

Drew Verlee22:07:43

interesting, ill have to take a look. If for no other reason then it will probably help me conceptualize whats going on.