# Terraform, OpenTofu, Pulumi or CDK: what to pick

> State and review decide the IaC tool, not syntax. Terraform or OpenTofu is the baseline; CDK suits AWS-only TypeScript teams, and Pulumi is the deliberate upgrade when you need a real language.

- Canonical: https://www.alpacamango.com/docs/choosing-infrastructure-as-code
- Author: Space Toucan
- Published: 2026-11-22 · Updated: 2026-11-22
- Topics: DevOps, AWS

**The default should be Terraform or OpenTofu. The plan-and-state model is the review and rollback mechanism, and the limits of HCL are a feature when changes must survive a code review. Choose AWS CDK only if you are AWS-only and already write TypeScript. Choose Pulumi when you need a real language and accept that you are operating more of the safety rail yourself.** The choice is not about syntax. It decides where state lives, how a change is reviewed, and what happens when the change is wrong.

## State and review are the decision

State is the record of what the tool thinks exists. Terraform and OpenTofu keep state in a file or remote backend, compare the desired configuration against it during a plan, and show a diff for review. Applying the plan moves state. A rollback sets the configuration back and applies again, with state reconciling the difference. A change to an S3 bucket lifecycle rule therefore shows the old rule, the new rule and the effect on state, not a vague diff of source.

Terraform is published under the Business Source License, which HashiCorp adopted in place of the Mozilla Public License; [OpenTofu](https://opentofu.org/) is a Linux Foundation project under the Mozilla Public License. OpenTofu targets state and plan compatibility, but a migration still means checking every provider and backend binding.

## AWS CDK is an AWS-specific shortcut

[AWS CDK](https://aws.amazon.com/cdk/) synthesises code in a general-purpose language, such as TypeScript, Python, Java or Go, into CloudFormation. That matters: you get normal code for loops and abstractions, but deployment and rollback inherit CloudFormation's change-set model. Drift detection is CloudFormation's own drift detection, not the tool's full reconciliation. The S3 lifecycle change appears as a CloudFormation change set, so review is closer to reading generated template output than to reading a Terraform plan.

CDK is the right exception for a team that is already AWS-only and TypeScript-first, and that does not want to learn HCL. The generated template is a cost. The abstraction that makes a loop over buckets easy is the same one that makes the diff harder to map to a single source line.

## Pulumi and the real-language trade-off

[Pulumi](https://www.pulumi.com/docs/) extends the CDK idea across clouds: you write in a general-purpose language such as TypeScript, Python, Go or C#. That is valuable when the alternative is HCL workarounds for branching and modularity. Pulumi defaults to a managed state backend and supports self-managed backends in object storage. If you self-manage, you own encryption, locking and access control for the most sensitive file in your infrastructure stack. That is real operational work, not a configuration detail.

Choose Pulumi when infrastructure logic is complex enough that HCL is the problem, and when you will run it like production software: tested, reviewed, with state treated as a secret. If your team will not operate state that carefully, the plan review in Terraform or OpenTofu will serve better.
