Live data from Hacker News

Ask HN: CDK vs. Terraform – which one do you prefer and why?

news.ycombinator.com

11–19 of 19 posts

Re: Ask HN: CDK vs. Terraform – which one do you prefer and why?

#11
Depends on the project.

Terraform is for when you are doing large projects in company, and want to have additional management features that CDK doesn't have.

On the flip side, for personal projects, you can get away with using boto3 library with the api it provides to create infrastructure, considering infrastructure probably won't change much, and its free. You pretty much just have to write a little wrapper to create the resource if it doesn't exist, then modify its attributes whether its just been created or if it already exists.

CDK, and pure cloudformation, and others are somewhere in between

Re: Ask HN: CDK vs. Terraform – which one do you prefer and why?

#14
I would recommend using Terraform, It has much better support and the documentation.

CDK is great if you are only using AWS but Documentation sucks. I actually worked on CFN team and we interacted a lot with CDK Team.

It's actually written in TypeScript and then constructs are converted to other languages using Projen

Re: Ask HN: CDK vs. Terraform – which one do you prefer and why?

#15
post #10

Earlier quoted context omitted.

> Vendor agnostic but you do have to write separate code per vendor wat

as opposed to using a different set of tool AND THEN write separate code for each vendor

That isn't vendor agnostic.

Re: Ask HN: CDK vs. Terraform – which one do you prefer and why?

#17
Our team uses CDK or CFN for building aws "platform level" infra (ie is go to for infra roles who build / maintain kube clusters or account level stuff), but terraform as the iac for devs who manage their own app-level resources eg rds, queues, hsms etc.

The rationale is that CDK/CFN seems to work more reliably "at scale" for commonly used stacks due to low drama rollbacks etc. Roles that are primarily infra tend to not mind using aws focused tooling.

For devs, the documentation and usability of terraform is just better, plus the wide range of 3rd party integrations is handy. While it can be fiddly / not as scalable it's also a lot easier to adopt resources or refactor stuff which you tend to need more with "precious" long lived app resources.

Post reply on HN