3 ms·
> The two aren't mutually exclusive. What I want is a DSL embedded in a full programming language, like chef's dsl in ruby. I've seen some atrocious Ruby for C
by sofixa 4y ago
> The two aren't mutually exclusive. What I want is a DSL embedded in a full programming language, like chef's dsl in ruby.
I've seen some atrocious Ruby for Chef, so I'm not sure I'd agree here. The advantage of a DSL is that it limits how far you can go. In the case of HCL pre-v2, it had some limitations around dynamism, but now that's out of the way IMHO it strikes a decent balance.
You can write hardcore HCL, but IMHO it's still way easier to parse by a human that bad Python or JavaScript.
As for CDKTF, I'd recommend you do. You can mix and match like having a project with CDKTF in e.g. Python or Go use regular TF HCL modules, but also vice versa, defining a module in TypeScript and consuming it from regular Terraform. So you can have the extra flexibility ( with all of it's advantages and risks) on a per module basis, not all or nothing.