This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-26
Channels
- # announcements (2)
- # asami (2)
- # aws (34)
- # babashka (6)
- # beginners (9)
- # calva (76)
- # chlorine-clover (10)
- # circleci (5)
- # clj-kondo (2)
- # clojure (40)
- # clojure-australia (3)
- # clojure-europe (15)
- # clojurescript (39)
- # conjure (1)
- # core-async (4)
- # cursive (4)
- # datahike (1)
- # datomic (69)
- # figwheel-main (1)
- # graalvm (16)
- # honeysql (9)
- # hyperfiddle (2)
- # jobs-discuss (2)
- # lsp (36)
- # luminus (1)
- # malli (11)
- # off-topic (13)
- # pathom (1)
- # portal (1)
- # portkey (3)
- # reitit (25)
- # reveal (1)
- # rewrite-clj (5)
- # spacemacs (2)
- # sql (4)
- # vrac (90)
I wonder if anyone has tried to make use of Terraform provider schemas in Clojure land
So I went and hacked a sample, that reads in provider schemas, and make some additional namespaced keywords to give helpers for typing out resources at the repl: https://github.com/viesti/clj-tf
just a hacky idea, was thinking on how to do somethink like CDK intellisense, but for pure data
the above doesn't make nested blocks into namespaced keywords though, since keywords have a single namespace only, could maybe make a convention to glue type name + block name as namespace
:thinking_face: isn't the output of cdk pure data anyway?
Btw is using CDK makes it really easier/more reliable to provision infrastructure? I have used it several times, but always come back to terraform with huge relief.
and langs that popup stuff in ides after typing a dot after a symbol kinda limit the amout of options to put "data" in
we run very small and shallow stacks, so pure aws cloudformation has so far been rather sufficient. the only parts where this is annoying is cases where you need stuff like 5 almost identical machines across 3 availability zones. in those cases i feel like cdk would help. after amazon added the import-export of variables it's somewhat usable approach
just thinking that spitting out data is nice in Clojure, there are these odd data spitting libs in other langs (like sceptre for python), CDK goes towards kind of extreme in having data spitting with this jsii thing for many langs, how to get a nice data feel for Clojure, with just some added typing (completion) helpers
I was using it, then followed the authors to typescript cdk and the DX was much better. Since it's all side effects, a functional language didn't add much benefit. My guess, they realised it wasn't a good fit and required a lot of maintenance
good summary, though I'd still kinda think that Clojure is pretty neat for generating data, and CloudFormation bottoms out as data (that is consumed by the CloudFormation service itself) and funny thing that only after just now trying to generate Terraform as JSON, the whole HCL mapping to data structures feels kinda nice 🙂 So this got me thinking on a way to make typing the data easier on Clojure side, best would be to have some intellisense that could suggest attribute names and references to other resource attributes, wondering this could partially be solved with fully qualified keywords 🙂
If you just want CF json then this works well https://github.com/brabster/crucible
ah yes, have forgotten about that 🙂 There also this edn-to-cfn spike that my colleague did, generates clojure.spec from the CF schema programmatically: https://github.com/portkey-cloud/edn-to-cfn
both Terraform and Cloudformation have their "spec" in machine readable format, allows to programmatically generate them
I guess the editor intellisense just wasn't there for Clojure, there's so many resource names and attributes/block per resource that looking up the correct names to spell without any help takes time, at least if you're not familiar with the resources
somewhere along those lines, if I remember correctly from following the #cdk-clj channel back in the day :)
So I thought that could these resource thingies be baked into keywords, bake the context into the keyword namespace+name, so completing & discovery would be easy. The keywords might become kinda long though 🙂 (like :aws_cloudfront_distribution-origin-custom_header/name
)
now remembering aws-api Conj presentation and datafy+nav, didn't Stu say that he almost had a navigable aws service api thing at hand? 🙂
The cognitect aws-api supports datafy/nav and works well with REBL (and David Chelimsky demo'ed that in a different talk at the same conj)
I'm not sure if that's what you're referring to?
it might be "datafy ARN" that I was trying to remember https://youtu.be/ppDtDP0Rntw?t=2639
Stu's example on look datomic logs, find a thing that looks like an ARN, datafy it and hop onto it, something like that 🙂
ah, don't know about that