The future of Terraform CDK

(github.com)

49 points | by mfornasa 2 hours ago ago

52 comments

  • vbernat 2 hours ago

    It's odd to always say "Hashicorp, an IBM company". Looks like they want to assign blame.

    I did try Pulumi a while back, but the compatibility with Terraform modules was not great, so I've switched to CDKTF, which can handle unmodified modules. Dunno if I'll switch back to Pulumi or just use OpenTofu directly.

    • jjice 2 hours ago

      > It's odd to always say "Hashicorp, an IBM company". Looks like they want to assign blame.

      All their branding does this now, including the HashiCorp logo on their website [0]. There's gotta be a name for this specific branding pattern, but I don't know it.

      [0] https://www.hashicorp.com/en/blog/products/terraform

    • packetlost 37 minutes ago

      I have absolutely nothing good to say about Pulumi. Stay far, far away.

      • mfornasa 26 minutes ago

        please expand on this, I am interested (for real!)

      • jen20 33 minutes ago

        Strange, I have a lot of good things to say about both it and Terraform.

        Probably some specifics might be more useful there...

    • selkin 31 minutes ago

      > It's odd to always say "Hashicorp, an IBM company". Looks like they want to assign blame.

      Or it's legal trying to preempt a risk.

      If it was the author just wanting to point at IBM, they'd mention it just once or twice, but using that awkward phrase throughout the text makes me think it was an edit mandated by a careful lawyer.

    • smithcoin 2 hours ago

      We use OpenTofu it’s pretty seamless

      • Hamuko an hour ago

        Does it do ephemeral values yet?

        • cube2222 an hour ago

          Yep, as of yesterday’s 1.11 release it’s supported!

          That also includes a new “enabled” meta argument, so you don’t have to hack around conditional resources with count = 0.

          [0]: https://opentofu.org/blog/opentofu-1-11-0/

          Disclaimer: affiliated with the project

          • Hamuko 5 minutes ago

            Damn, might finally be able to use it. The lack of ephemeral values was a major blocker.

          • lijok 38 minutes ago

            How do you migrate from count/for_each to `enabled` ?

            • cube2222 29 minutes ago

              You can just switch from `count = 1` to `enabled = true` (or vice-versa, works back-and-forth) for a resource and tofu will automatically move it next time you apply.

              It's pretty seamless.

              • lijok 22 minutes ago

                Amazing. Good work !

      • benatkin an hour ago

        Now more will be using a combination of OpenTofu and Terraform, and there will probably be some tacit endorsement of OpenTofu by Hashicorp folks in their communication with those who are using both. Good to see!

    • atonse 2 hours ago

      I was thinking the same thing about the "an IBM company". My guess is that it's a lazy find/replace.

      • Pet_Ant 17 minutes ago

        I assume it's a matter of branding and making IBM look more modern by associating with the Hashicorp brand.

    • firesteelrain an hour ago

      It’s how Red Hat identifies themselves too

  • moltar 4 minutes ago

    This is so sad. It’s a great project. Needs to be forked and maintained. If anyone forks please email me I’ll contribute.

  • callumgare 6 minutes ago

    As an alternative is anyone considering https://sst.dev/ (which uses Pulumi under the hood)? We use it at work and I’ve been quite happy with it

    • moltar 3 minutes ago

      It’s not an alternative at all. Terraform CDK is basically TypeScript transpired to HCL. You can codegen TypeScript bindings for any provider. And then write normal TypeScript.

  • crimsonnoodle58 an hour 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..

    • lijok 44 minutes ago

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

      • crimsonnoodle58 12 minutes ago

        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.

  • mfornasa an hour ago

    Rug pulls on infrastructure components seem even worse than other rug pulls as they can hit your entire infra codebase at once

    • lillecarl 44 minutes ago

      This is why infrastructure people are conservative by nature, it's so damn much gruntwork to migrate without downtime

      • mfornasa 28 minutes ago

        And it happens while we are all very enthusiastically dedicated to migrating off Kubernetes ingress-nginx. Just as planned.

  • vanschelven 28 minutes ago

    "Will be sunset on Dec 10"... commit date: Dec 10.

    That seems like rather short notice.

  • GardenLetter27 2 hours ago

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

    • tapoxi an hour ago

      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.

      • ryandvm an hour ago

        Exactly. It's just so much cleaner to do it in the Cloud provider's native tooling. The impedance mismatch from Cloud-agnostic abstractions always just makes thing shitty enough that in the long run you spend more time dealing with weird edge cases.

        Besides, actual full-scale Cloud migrations are exceedingly rare.

    • tetha 27 minutes ago

      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.

    • scruff3y an hour ago

      Just use Terraform?

      • cholantesh an hour ago

        Yeah I'm struggling to see the value here.

        • stackskipton 43 minutes ago

          The value for TFCDK was Developers don't have to learn another language, they can just continue to use existing language they already know.

          Downsides are doing infrastructure in a programming language was always problematic unless developer was skilled at Ops which most who used TFCDK were not.

    • srmatto an hour ago

      If you want maximal complexity use Crossplane. :P

    • mfornasa an hour ago

      Probably Pulumi

    • sshine an hour ago

      Terranix? ;-)

      • madjam002 an hour ago

        Not gonna lie Terranix has been working great for us, all our configuration is in Nix files anyway so it's so easy to just pass stuff in rather than using Tf variables etc

      • lillecarl 42 minutes ago

        Yes, the NixOS module system is so much more composable than the TF one

  • deadfece an hour ago

    At least they gave us some notice, that’s much appreciated.

  • kbar13 30 minutes ago

    we're using cdk since 100% of our stuff is in aws but will soon need to hook up some external resources like cloudflare. looked at tfcdk a while back but didn't think it was a good idea (glad). still trying to figure out a good way forward and hoping it's not to rip the bandaid and migrate everything to terraform / pulumi

  • zer0-c00l 2 hours ago

    This is a bummer. I don't particularly like Pulumi but use it anyways because for my use cases being able to write actual code is really impactful. Sucks to see fewer options in that space

    • leetrout an hour ago

      The often excluded option is dynamically generating JSON and feeding that to TF instead of HCL.

      You can combine it with tools like Dhall or my personal preference Jsonnet instead of imperative languages for an interesting experience for reusable pieces outside of module concepts.

  • NeckBeardPrince an hour ago

    Hashicorp, an IBM company

  • dev_l1x_be an hour ago

    It would be great to have an alternative to Terraform that uses a bit more advanced provider (at last for AWS). Does OpenTofu use that same provider?

    • jpitz 35 minutes ago

      The providers for tofu are by design the same as for terraform.

      Also, for large providers like AWS, GCP, Azure, etc - these are often largely authored by the hyperscaler themselves, for better or worse.

    • lijok an hour ago

      It does. What are you looking for in a more advanced AWS provider?

  • lijok 44 minutes ago

    Good move. They clearly didn't have the resources they needed. The design of the CDKs was atrocious.

  • yearolinuxdsktp an hour ago

    That’s a real shame. It seems like Pulumi is the only alternative for internal DSLs for IaaC? I always found HCL to be quite terrible, slowly becoming less painful, but not really refactoring-friendly.

    Terraform CDK had promise as a blessed infrastructure-as-actual-code solution from the official maintainer of Terraform, so easier to sell internally rather than something from a new vendor like Pulumi. I feel sorry for those teams who have migrated to TF CDK.

    Internal vs external DSLs explained in the middle of this page: https://martinfowler.com/bliki/DslQandA.html

    • chuckadams an hour ago

      Kubernetes has a few things, including cdk8s. Yoke looks promising too.

  • lloydatkinson an hour ago

    What was the point of it? Terraform supports AWS anyway.