logoalt Hacker News

GardenLetter27last Wednesday at 7:32 PM8 repliesview on HN

Damn, what are the best alternatives here? For pure AWS I guess CDK directly is okay, but locks you in.


Replies

tapoxilast Wednesday at 7:44 PM

I went with CDK, I'm locked into AWS already and it means my major dependency for IaC is my cloud vendor and not a third party.

If I really need to migrate off of AWS at some point I'll throw an LLM at it.

show 2 replies
tethalast Wednesday at 8:35 PM

Hm, we have a few very repetitive terraform projects to setup structured infrastructure clusters. For those, we just use ansible with a bunch of templating to generate a configurable, HCL-based terraform module and version that.

It's a bit of an "Caveman solve problem with rock" approach, but for very regular projects it's great. A new cluster is some group vars, larger changes to the structures can be easily reviewed - and if you really really have to, you can also just modify the generated code by hand to fix something your generation code can't deal with right now.

rendawlast Thursday at 4:26 AM

I made https://github.com/andrewbaxter/terrars ! It's great! You get more benefits if you're in a Rust project (obviously) but it has some things that make it a good alternative anywhere:

- More accurate types/type safety than the CDK (for static feedback on required parameters, etc)

- No CLI required - just plain Rust (provider definitions can be published as normal rust packages so you don't have to generate them yourselves, and I've published a bunch of common ones - docker, aws, etc)

- Simpler: Terraform CDK had this crazy flow where it (go code) generated typescript code then used some transpiler to generate target language code. The output wasn't pretty, and there were bugs. Your project directory would get filled with boilerplate generated files.

It generates tf json files and has a fairly safe way for handling variable interpolation and escapes - I haven't hit any weird bugs with it.

scruff3ylast Wednesday at 7:33 PM

Just use Terraform?

show 2 replies
theknarflast Thursday at 2:16 PM

Normal Terraform, Pulumi or OpenTofu

show 1 reply
mfornasalast Wednesday at 7:36 PM

Probably Pulumi

show 1 reply
srmattolast Wednesday at 7:38 PM

If you want maximal complexity use Crossplane. :P

sshinelast Wednesday at 7:34 PM

Terranix? ;-)

show 2 replies