Every infrastructure as code tool demos the same way. You write twenty lines, you run an apply, a virtual machine appears. It looks solved.
The part that decides whether you are happy in two years is nowhere in that demo. It is what the tool writes down about what it created, where that record lives, what happens when two engineers run an apply at the same moment, and what the tool does when somebody fixes production by hand at 2am and never tells it.
That record is the state file, and state is the actual product. Everything else, the language, the provider ecosystem, the module registry, is negotiable. State handling is not, because a corrupted or lost state file turns a managed estate back into an unmanaged one, and the recovery is manual reconciliation of every resource the tool thought it owned.
The second thing nobody tests before buying is the multi-cloud claim. Every tool in this category says it works across clouds. In a narrow and mostly useless sense, that is true. In the sense people mean when they buy it, it is false, and being honest about that will save you a year of building an abstraction that nobody wants.
Key takeaways
- State is the product. Judge a tool on locking, backend durability, import, and recovery from a corrupted state file before you judge it on syntax.
- Drift detection tells you that reality diverged. It cannot tell you whether the divergence was a mistake or a fix, which is why auto-remediation is dangerous by default.
- Multi-cloud portability is real at the workflow layer and mostly fictional at the resource layer. One tool across three clouds still means three sets of provider-specific code.
- The choice between a configuration language and a general-purpose language is a choice about who maintains the code in three years, not about expressiveness.
State is the product
An infrastructure as code tool is a reconciliation engine wrapped around a database. The database happens to be a JSON file most of the time, which disguises how central it is.
The engine does three things on every run. It reads the desired configuration. It reads the recorded state, which is its memory of what it previously created and the identifiers it needs to find those resources again. It reads the live provider API. Then it diffs all three and produces a plan.
Take away the state and the tool cannot tell the difference between “this resource does not exist yet” and “this resource exists but I do not know about it.” Those two situations produce opposite plans, one creates, one imports or leaves alone, and the tool cannot distinguish them without its memory.
That is why the following properties matter more than anything on a feature grid.
Locking. Two applies running concurrently against one state file will interleave writes and corrupt it. Every serious backend implements a lock: a DynamoDB item, a blob lease, a row in the vendor’s database. Check that your backend actually enables it, because file-on-object-storage backends without a lock table are still common and silently unsafe.
Durability and versioning. The state file needs versioned, backed-up storage. Not because the tool corrupts it often, but because when a bad import or a partially failed apply leaves it wrong, rolling back to yesterday’s version is the difference between a ten-minute fix and a two-day reconciliation.
Secrets in state. Resource attributes end up in state verbatim, including generated passwords, connection strings, and private keys. A state file is a credential store whether or not you wanted one. Encrypt it at rest, restrict read access as tightly as you restrict production credentials, and assume anything you pass through the tool is recorded.
Import. You will inherit resources created by hand or by another tool. The quality of the import path, whether it is one resource at a time or a bulk generator that emits configuration to match, determines how long the migration takes. This is the single most underweighted feature in the category.
Blast radius. One giant state file means one lock, one plan that takes minutes, and one corruption event that affects everything. Splitting state by lifecycle, network separate from data stores separate from applications, is the standard mitigation, and it costs you cross-state references that have to be resolved through remote state lookups or data sources.
Needs first-hand data: Take your largest existing state file and time a no-change plan against it, from command start to plan output. Then record the state file size and resource count. Those three numbers tell you whether your state is already too large to iterate against, and they are the only honest input to a splitting decision.
Drift detection, and what it can honestly tell you
Drift is the gap between what the state says exists and what the provider API says exists. Detecting it is mechanically simple: refresh every resource against the live API and diff.
The hard part is not detection. It is interpretation.
A drifted resource means one of four things, and the tool cannot tell you which. Somebody made a deliberate emergency change that should be promoted back into code. Somebody made a careless change that should be reverted. Another system, an autoscaler, a controller, a managed service, legitimately owns that field and always will. Or the provider itself changed a default, normalised a value, or added a field, and nothing actually drifted at all.
That last category is the reason drift reports get ignored. A tool that reports twenty differences every morning, eighteen of which are provider noise, trains the team to close the report without reading it. Then the two real ones go with it.
Three practices make drift detection worth running.
Ignore the fields you do not own. Explicitly exclude attributes managed by autoscalers, service-linked roles, or cloud provider automation. Every tool has a mechanism for this. Using it is what makes the remaining signal readable.
Run it on a schedule, separately from applies. A drift check on a cron, reporting to a channel, is an early warning. A drift check that only runs when somebody happens to apply means you find out about the 2am fix three weeks later, in a plan that wants to destroy it.
Do not auto-remediate by default. Automatic revert is the feature everyone asks for and the one that causes incidents. The emergency change that drift detection wants to undo is sometimes the only thing keeping the service up. Alert, require a human decision, and make “promote this into code” as easy a path as “revert it.”
The exception is a narrow allowlist of resources where you are certain no legitimate manual change exists: security group rules, public bucket ACLs, IAM policy attachments. Auto-revert those. Nothing else.
Needs first-hand data: Run a refresh-only plan against production every morning for two weeks and classify every reported difference into the four categories above. The ratio of real drift to provider noise in your own estate determines whether drift detection is a useful signal or an alert you will learn to ignore.
The multi-cloud claim, tested honestly
Every tool here claims multi-cloud support. Here is what that actually buys you, and what it does not.
What is genuinely portable: the workflow. One command to plan, one to apply, one review process, one place where CI runs infrastructure changes, one state backend pattern, one approval gate. This is real, and it is worth a great deal. An engineer who knows how to ship a change to the AWS estate can ship a change to the GCP estate without learning a new toolchain.
What is genuinely portable: the surrounding ecosystem. Policy as code, drift detection, cost estimation, secret injection, and CI integration all work the same way regardless of which cloud a resource lives in. Building that ecosystem once instead of three times is most of the value.
What is not portable: the resources. An AWS load balancer and a GCP load balancer are different objects with different fields, different lifecycle behaviour, and different failure modes. The tool’s provider for each exposes that difference faithfully, because hiding it would mean the provider could not express the cloud’s actual capabilities. Your AWS code and your GCP code share syntax and share nothing else.
The trap is the module that tries to close that gap. Someone writes an internal abstraction, a company_service module, that takes a generic input and emits AWS resources or GCP resources depending on a flag. It works for the first two service shapes. Then a team needs a feature that exists on one cloud and not the other, the abstraction grows a passthrough, and within a year it is a leaky interface that is harder to read than either cloud’s native code and that exactly one person understands.
Kubernetes is the one honest exception, and it is an exception because it is not an abstraction over clouds. It is a separate API that happens to run on all of them. A Deployment is genuinely the same object everywhere. That portability stops precisely at the point where you need a load balancer, a managed database, or an object store, which is to say almost immediately, and those come back through cloud-specific resources or through a control plane like Crossplane that has the same leaky-abstraction problem in a different location.
The practical stance: pick one tool for the workflow, accept that you will write per-cloud code, and do not build the unifying abstraction. Being able to read another team’s infrastructure code without learning a new tool is the win. Write it once for each cloud, honestly.
This connects directly to how you run the tool in CI, which is covered in the CI/CD platforms guide, and to the reconciliation-loop alternative in GitOps tools.
Terraform

Terraform is the category default: a declarative configuration language, a provider model that covers essentially every API worth managing, a state file, and a plan-then-apply workflow that everyone in the industry already understands. HashiCorp moved it from the Mozilla Public License to the Business Source License, which changed the calculation for anyone building a product on top of it and triggered the fork that became OpenTofu. For most teams simply running infrastructure, the licence is not a blocker. For vendors, platform teams shipping internal products, and organisations with strict licence policy, it is.
Pros
- The largest provider ecosystem by a wide margin, which means the resource you need almost certainly exists
- Enormous hiring pool and a body of public modules, examples and answers for nearly every problem
- The plan output is the industry’s shared vocabulary for reviewing an infrastructure change
- A mature registry and module system that makes internal reuse straightforward
Cons
- The Business Source License is a genuine blocker for anyone embedding it in a product, and a policy question for some enterprises
- The configuration language is deliberately limited, and loops, conditionals and dynamic blocks get awkward fast
- No built-in support for splitting large estates, so state layout and cross-state wiring stay a design problem you solve yourself
- Provider bugs surface as confusing plan diffs, and the fix schedule is not yours
Best for: Teams running infrastructure for their own use who want the largest ecosystem and the easiest hiring, and whose legal position is unaffected by the licence change.
Pricing: The CLI is free under a source-available licence with restrictions on competitive use. The vendor sells a hosted platform metered on managed resources, with tiers that add policy enforcement, private module registries and access control.
OpenTofu

OpenTofu is the fork of Terraform created after the licence change, governed under a foundation and licensed under the Mozilla Public License. It reads the same configuration, uses the same providers, and produces the same state format, which makes the migration path unusually short for a fork of this size. It has since added capabilities that diverge from upstream, including native state encryption and early evaluation of variables, so the two are no longer identical by design.
Pros
- Open source under a permissive licence with foundation governance, which removes the policy question entirely
- Consumes the existing provider ecosystem, so nothing about your resource coverage changes
- Native client-side state encryption addresses the secrets-in-state problem without a wrapper
- Migration from Terraform is realistically a binary swap plus a test cycle for most estates
Cons
- Feature divergence runs in both directions now, so modules written against newer upstream syntax may need adjustment
- The commercial tooling ecosystem grew up around Terraform first, and support quality for the fork varies by vendor
- Smaller community, which shows up as fewer public answers for unusual problems
- You inherit every one of Terraform’s language limitations, because compatibility was the point
Best for: Teams who want the Terraform workflow without the licence constraint, especially vendors and platform teams who ship infrastructure code as part of a product.
Pricing: Free and open source with no vendor and no bill. Several third-party platforms sell hosted execution and state management for it, priced on their own terms.
Pulumi

Pulumi runs infrastructure as code in general-purpose languages: TypeScript, Python, Go, C#, Java. The program executes, builds a resource graph through the SDK, and the engine reconciles that graph against state exactly as a declarative tool would. The result is real loops, real functions, real types, real package management, and real unit tests. The cost is that a program can do anything, and infrastructure code that can do anything is harder to review than a description that cannot.
Pros
- Actual language features replace the workarounds a configuration language forces, which matters most in dynamic or generated infrastructure
- Type checking catches mistakes at author time rather than at plan time
- Testing infrastructure logic with normal unit test tooling is genuinely possible
- Secrets are encrypted in state by default rather than by convention
Cons
- A program that reads a file, calls an API, or branches on the current time produces non-reproducible plans, and nothing stops you writing one
- Reviewing a diff of imperative code is meaningfully harder than reviewing a diff of declarations, and the review is where infrastructure safety lives
- The default state backend is the vendor’s hosted service, so self-managing state is a deliberate step rather than the norm
- Smaller ecosystem and hiring pool than the Terraform world
Best for: Product engineering teams who already own their infrastructure, work in one of the supported languages, and have enough dynamic resource generation that a configuration language is actively fighting them.
Pricing: The engine is open source and free to self-manage. The vendor’s hosted service is metered on managed resources with a free tier for individuals, and higher tiers add policy, drift detection and access control.
AWS CDK
The AWS Cloud Development Kit lets you define AWS infrastructure in a general-purpose language, then synthesises CloudFormation templates and hands them to the CloudFormation service to deploy. That is the architectural fact that decides everything about it: your state is CloudFormation stacks managed by AWS, not a file you own, and every deployment behaviour you get is CloudFormation’s behaviour. The construct library is the real attraction, since a single high-level construct expands into the dozens of resources a correct AWS setup actually requires.
Pros
- No state file to store, lock, back up or lose, because CloudFormation holds it server-side
- High-level constructs encode AWS best practice, so a handful of lines produces a sane, wired-up stack
- Deployment rollback on failure is a service guarantee rather than something you build
- First-party, so new AWS services and features arrive without waiting on a third-party provider
Cons
- AWS only in any practical sense, so it is not a candidate if a second cloud exists or might
- CloudFormation’s failure modes are now yours: slow stack updates, stacks stuck in a failed rollback state, and drift you cannot fix without console intervention
- The synthesised template is what actually deploys, so debugging means reading generated output rather than what you wrote
- Constructs abstract heavily, and when you need to reach past them the escape hatches are awkward
Best for: AWS-only teams, especially serverless and application-centric ones, who want managed state and prefer application-language tooling.
Pricing: The framework is free and open source. You pay only for the AWS resources it creates, since CloudFormation itself carries no charge for standard resource types.
Crossplane

Crossplane inverts the model. Instead of a CLI that runs a plan, it installs controllers into Kubernetes that continuously reconcile cloud resources represented as Kubernetes custom resources. Your database becomes an object in the cluster, and a controller works to make reality match it, forever. The headline capability is composition: platform teams define an abstract claim, say a PostgresInstance, and application teams request one without touching cloud specifics.
Pros
- Continuous reconciliation means drift is corrected automatically as a property of the design, not a scheduled job
- Kubernetes RBAC, admission control and the whole controller ecosystem apply to infrastructure requests for free
- Composition gives platform teams a real internal interface with a genuine abstraction boundary
- Fits cleanly into a GitOps flow, since infrastructure becomes another set of manifests in a repo
Cons
- Continuous reconciliation is exactly wrong for the emergency manual change, which the controller will undo while you are still debugging
- Cluster state now holds your infrastructure control plane, which makes the cluster a dependency of your cloud estate and a serious recovery problem if it is lost
- Writing compositions is a real engineering discipline, and the abstraction leaks in the same way every multi-cloud abstraction leaks
- Provider coverage and maturity lag the established providers, especially for newer cloud services
Best for: Platform teams already committed to Kubernetes who want to offer self-service infrastructure to application teams through an internal API rather than through pull requests.
Pricing: Open source under a permissive licence with no licence cost. Commercial distributions and hosted control planes are sold separately, priced on managed resources or control planes.
Ansible
Ansible is a different category that gets compared to this one because the boundary is genuinely blurry. It is agentless configuration management: it connects over SSH or WinRM and executes ordered tasks, each of which is written to be idempotent. It keeps no state file, which means it cannot tell you what it created, cannot detect drift in the sense the other tools mean, and cannot destroy an estate. What it is unmatched at is the inside of a machine: packages, services, config files, and ordered operational procedures across a fleet.
Pros
- No agent and no state file, so the operational footprint is close to zero
- Best in class for in-instance configuration, package management and ordered operational runbooks
- Reads clearly to people who are not infrastructure specialists, which broadens who can safely contribute
- Excellent for procedural work that declarative tools handle badly, like rolling restarts and staged upgrades
Cons
- No state means no plan, no reliable preview, and no way to know what it believes exists
- Provisioning cloud resources with it works but is the weakest way to use it, since deletion and drift are unmanaged
- Execution is sequential and ordered, so large fleets get slow and failures leave partial application
- Idempotence is a property each task author has to earn, not a guarantee the tool enforces
Best for: Configuring the inside of machines and running ordered operational procedures, alongside a state-based tool that provisions the machines themselves.
Pricing: The core is free and open source. The vendor sells an enterprise automation platform, typically licensed per managed node, adding a control plane, RBAC and certified content.
SST
SST is a framework for building full-stack applications on AWS and other providers, built on the Pulumi engine and the Terraform provider ecosystem underneath. It is scoped deliberately narrowly: its components are application-shaped, a function, a queue, a static site, a container service, rather than raw cloud primitives. The differentiator is the development loop, where it proxies cloud events to code running on your laptop so you debug against real cloud services instead of local emulators.
Pros
- Application-shaped components collapse the boilerplate of wiring functions, queues, permissions and endpoints correctly
- Live development against real cloud services removes a whole class of emulator-versus-reality bugs
- Built on an established engine and provider set, so the escape hatch to raw resources exists when you need it
- Per-developer and per-branch environments are a first-class idea rather than something you assemble
Cons
- Scoped to application infrastructure, so your networking, shared data stores and organisational plumbing need something else
- The framework has been rewritten in a meaningful way before, and that history is a real adoption consideration
- The abstraction is opinionated, and fighting it is worse than not using it
- Small ecosystem relative to everything else here, with correspondingly fewer answers when you hit an edge
Best for: Product teams shipping serverless or container applications on AWS who want the application and its infrastructure defined together in one TypeScript codebase.
Pricing: The framework is open source and free. Optional hosted services for deployment and environment management are sold separately on a per-seat or per-environment basis.
How to choose
Answer four questions in this order. Each one eliminates more than the next.
Do you need to manage general cloud infrastructure, or configure machines? If it is the inside of instances, packages, services, ordered upgrades, that is Ansible and the rest of this list is the wrong category. Most teams need both, and running both is normal.
Is your licence position constrained? If you ship infrastructure code as part of a product, or your legal team has a position on source-available licences, that decides between Terraform and OpenTofu before any technical consideration.
Is AWS the only cloud, now and plausibly later? If yes, AWS CDK removes state management entirely and gives you construct-level abstractions that are genuinely good. If there is any chance of a second cloud, do not start there.
Who writes and reviews this code? A platform team that lives in infrastructure will be more productive and safer in a constrained configuration language, because the constraint is what makes review possible. Product engineers who touch infrastructure occasionally are usually faster in a language they already know.
Then pick the state backend deliberately, verify locking is actually on, and split state by lifecycle before the plan times start hurting rather than after.
| Tool | Model | State lives | Scope | Picks itself when |
|---|---|---|---|---|
| Terraform | Declarative config | Your backend | Any provider | Ecosystem size wins and the licence is fine |
| OpenTofu | Declarative config | Your backend | Any provider | Licence policy rules out source-available |
| Pulumi | General-purpose language | Vendor or your backend | Any provider | Dynamic generation fights a config language |
| AWS CDK | General-purpose language | CloudFormation, server-side | AWS only | AWS only and you want no state file |
| Crossplane | Kubernetes controllers | Cluster etcd | Any provider | Self-service infrastructure through an internal API |
| Ansible | Procedural, agentless | None | Inside the machine | The task is configuration, not provisioning |
| SST | Framework on Pulumi | Vendor or your backend | Application infrastructure | The app and its infrastructure ship together |
Needs first-hand data: Before committing, take one real service from your estate and build it end to end in each of your two finalists. Record author time, plan wall-clock time, lines of code, and how long it takes a second engineer who did not write it to make a small change safely. That last number is the one that predicts your next three years.
Frequently asked questions
Should I migrate from Terraform to OpenTofu?
If the licence affects you, yes, and the migration is unusually cheap for a fork because state format and provider compatibility were the explicit design goals. If the licence does not affect you, the argument is weaker and comes down to governance preference and the specific features that have diverged. Do not migrate on principle alone if you are consuming a lot of commercial tooling built around the original, since support quality varies. The trade-offs are worked through in detail in Terraform alternatives.
Is Crossplane a replacement for Terraform?
For self-service provisioning of a known catalogue of infrastructure, yes. For the long tail of one-off resources, DNS records, organisational accounts, exotic service configurations, it is a worse fit, and most teams that adopt it end up running both. The bigger question is whether you want your cloud estate to depend on a Kubernetes cluster staying healthy, because with Crossplane it does.
How do I stop secrets ending up in the state file?
You mostly cannot, because resource attributes are recorded verbatim. Treat the state file as a credential store: encrypt it at rest, restrict read access to the same set of people who hold production credentials, and prefer resources that reference a secret by identifier over ones that take the value inline. Where the tool supports native state encryption, use it. The generation and injection side is covered in secrets management for CI/CD pipelines.
How large should a single state file be?
Small enough that a no-change plan finishes fast enough that you run it without hesitating, and small enough that a corruption event does not take out unrelated systems. In practice that means splitting by lifecycle: long-lived networking in one, data stores in another, applications in a third, and per-environment separation throughout. The cost is cross-state references, which is a real cost, so do not split further than the blast radius argument justifies.
Does infrastructure as code remove the need for a deployment tool?
No. These tools provision and change infrastructure. Rolling out a new application version with a canary, a progressive traffic shift, and an automated rollback is a different problem with different primitives, covered in deployment and release orchestration tools. Using an infrastructure tool as a deployment tool works until the first rollback you need in under a minute.
Related reading
- Best CI/CD platforms — where infrastructure changes actually run, and how to gate them.
- Terraform alternatives — the post-licence-change migration paths in detail.
- Best GitOps tools — the continuous reconciliation model and where it beats plan-and-apply.
- Best secrets management for CI/CD pipelines — how credentials reach an apply without living in a file.
- Best deployment and release orchestration tools — the layer above provisioning.
- Best container registries — where the artefacts your infrastructure runs come from.