Settings

Theme

Ask HN: What's better Terraform or AWS CDK?

9 points by Kalpeshbhalekar 2 years ago · 12 comments · 1 min read


If one is not planning to go multi-cloud, is CDK a better decision?

mousetree 2 years ago

We've been using CDK for Terraform[1] for a year or two for both AWS and GCP. It's working great. We especially like that it supports Typescript.

[1] https://developer.hashicorp.com/terraform/cdktf

speedgoose 2 years ago

https://opentofu.org/ is better than terraform, as it’s a fork that happened before terraform became not open source.

  • szszrk 2 years ago

    I am using it for a new project as my first contact with this approach (long time Ansible user). So far it is great, both tofu cli, actual execution and vscode plugin.

    But I'm curious about the providers ecosystem. Isn't that the weak link in this project? Biggest ones are actually developed by Hashicorp and not the big 3 cloud vendors. I also failed to find any independent docs on them, just a huge pile of folders in GitHub with basically no interface nor description what is what.

    So while I use OpenTofu I still really fully on terraform docs.

    Are there similar resources within OpenTofu project?

andrewfromx 2 years ago

https://www.pulumi.com/

  • KalpeshbhalekarOP 2 years ago

    Terraform requires a proprietary domain-specific language (DSL) and is not open source. - This looks interesting

    Won't Pulumi change its license like terraform a few years down the line?

Sevii 2 years ago

Terraform and the CDK use different programming models to achieve similar goals. The CDK takes a more dynamic scripting approach much like Gradle, while Terraform is more descriptive and declarative. Functionally, I think they have similar capabilities.

JojoFatsani 2 years ago

If you plan on making your devs do all your infra work, maybe CDK would be better. But you will eventually regret not having TF and its huge ecosystem of modules and integrations.

ldjkfkdsjnv 2 years ago

CDK is far better if you are only on AWS and need advanced cloud setups.

gabriel_dev 2 years ago

I guess the vendor lock issue is not as harsh if using Terraform

noop_joe 2 years ago

It might not matter _that much_ depending on the complexity of the application you're modeling.

There are lots of options. A few things to consider:

- Is it a dedicated individual or group responsible for the IaC? What are they comfortable with? - Details about the running app will need to find their way into the infra somehow (env vars at least), if it's a separate group or individual, what will be the most obvious process to perform that exchange of information?

I wrote a short piece about point two [1]. Disclosure: I work at a company building a platform with its own opinionated IaC.

1. https://noop.dev/blog/build-apps-not-infrastructure/

dakiol 2 years ago

Ansible

uaas 2 years ago

CloudFormation

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection