| I just started using CDK for a project, and after having fought with terraform and trying pulumi, I have to say CDK is a breath of fresh air. Really well thought out, makes doing things the right way easy as well. The biggest difference I can see between CDK and pulumi (other than CDK only being for AWS) is that the CDK is more opinionated. When you spawn a new database, it'll automatically create a secret in secretsmanager, and set up rotation etc. And since it can assume IAM, it generates granular policies for you easily with calls like `dbInstance.grantRead(lambdaInstance)` etc, instead of you having to manually construct a JSON policy. I really think the pulumi / CDK method of "Use a real programming language to generate a declarative spec" is the right way to go. For those keeping score: - chef/puppet: imperative language, imperative effects - ansible: declarative language, imperative effects - terraform: declarative language, declarative effects - CDK/Pulumi: imperative language, declarative effects Not to mention, CloudFormation actually allows ~transactions, which is something you can't really get without cooperation from the cloud provider Edit: I incorrectly mentioned that terraform uses cloudformation to get transactions, but it does not |
Terraform doesn't use CloudFormation on AWS (and I thought Pulumi used Terraform under the covers in some capacity?). I've also seen a lot of CloudFormation stacks get into completely unrecoverable states because AWS was trying to roll back a transaction, but the rollback failed. If you have a premium support contract, someone can un-stick it for you, but for the rest of us we just had to create a new stack. I've been off AWS for a year and change, so maybe this has improved?
In whichever case, I've only dabbled with CDK, but I was disappointed. What I really want is a better Troposphere[0]--sort of an AST library for CloudFormation, ideally type-safe. I don't care that the backend is CloudFormation in particular, but the idea is that we should have a clean separation between the backend diff engine and the abstraction layer that humans use to DRY the input to the backend diff engine.
[0]: https://github.com/cloudtools/troposphere