← Back to context

Comment by crimsonnoodle58

4 days ago

This is particularly frustrating as I've spent the last year writing many thousands of lines of CDKTF Python.

HCL just does not have the modularity and expressiveness that Python, or other languages CDKTF supports.

I guess I'll spend another year migrating to Pulumi now..

The lack of expressiveness of HCL is the point and what makes it so good

  • Being able to inherit from Ingress and add a parameter of say public=True/False and then it change annotations, middleware, etc and then being able to re-use that across 100s of stacks is very powerful. DRY is not something HCL is good at.

    • Getting too clever with an imperative language in what is inherently a declarative domain, is an idea bad enough that they invented a whole new language to avoid you doing it. But some lessons have to be learned the hard way I guess

      10 replies →

    • That is... not a good idea at all imo. It's very, very easy to over-DRY infrastructure config and it sounds like you're well past that point.

  • That's very subjective. Concepts like iterations are inevitable, and they don't look great in a declarative language like HCL.

    I also find refactorings considerably harder in a declarative language, since configurations have a rigid structure.