Resources Infrastructure

Top IaC Tools: Comparing Modern Infrastructure as Code

Compare the leading Infrastructure as Code (IaC) tools, from Terraform and OpenTofu to Pulumi, Crossplane, and Kestra, to automate provisioning and day-2 operations.

TL;DR — The main IaC tools are OpenTofu and Terraform (declarative HCL), Pulumi (general-purpose languages), Crossplane (Kubernetes reconciliation), Ansible (server configuration), and CloudFormation (AWS only). Pick the provisioner that fits your stack, and use an orchestrator such as Kestra to run plans, approvals, applies, and follow-up steps as one governed workflow.

Infrastructure as Code (IaC) replaced console clicks with version-controlled definitions. Choosing a tool now means choosing between three models: declarative domain-specific languages, general-purpose programming languages, and Kubernetes control loops. The leading options are Kestra, OpenTofu, Terraform, Pulumi, Crossplane, Ansible, and AWS CloudFormation. This guide compares how each handles state, licensing, and execution, and how to run them together in production.

What defines modern Infrastructure as Code

IaC manages infrastructure through machine-readable definition files instead of manual configuration. Two models coexist:

  1. Declarative state modeling: you describe the end state (for example, three private subnets and two PostgreSQL instances). The engine compares it with what exists and makes only the API calls needed to close the gap. OpenTofu, Terraform, Pulumi, and CloudFormation work this way.
  2. Procedural execution: you write the steps to configure a system (install a package, copy a file, restart a service). Ansible works mainly this way.

Most platform teams separate provisioning (networks, clusters, databases, IAM) from configuration management (packages, services, configuration files). Mixing both in one script creates fragile dependencies and long runs. Provisioning is also only one phase of infrastructure orchestration, next to testing, compliance checks, and delivery.

Why teams look beyond a single IaC engine

Running an IaC CLI from a laptop is simple. In a team, three limits appear.

  • The work does not stop at apply. A run that creates a Kubernetes cluster is followed by Helm releases, DNS records, monitoring agents, and database migrations. Spread across ad-hoc CI scripts, these steps have no shared view and no common audit trail.
  • Concurrency needs control. State locking prevents two runs from writing at once, but when a run dies mid-way, someone with direct access to the state backend has to clear the stale lock by hand.
  • Licensing changed. In 2023, HashiCorp moved Terraform from MPL-2.0 to the Business Source License, and OpenTofu was forked under the Linux Foundation. Many teams reviewed whether their pipelines should depend on a single vendor’s binary.

How we evaluated these IaC tools

We compared each tool on five criteria:

  1. Authoring model: HCL, general-purpose languages, or YAML/JSON.
  2. State and locking: how resources are tracked, how drift is detected, how concurrent runs are isolated.
  3. Execution architecture: a CLI run at a point in time, or a controller that reconciles continuously.
  4. Provider coverage and maintenance: available providers and the foundation or company behind the project.
  5. License: OSI open source (Apache 2.0, MPL-2.0, GPLv3) or source-available and proprietary.

1. Kestra: orchestration for IaC pipelines

Kestra is an open-source, declarative orchestration platform. It does not replace OpenTofu, Terraform, or Ansible: it runs them. Workflows are written in YAML, and each step runs in its own container, so a flow can call OpenTofu, an older Terraform version, a Python check, and an Ansible playbook without dependency conflicts.

A typical infrastructure flow clones the repository, runs a plan, stops on a Pause task until an engineer approves, then applies the reviewed plan and runs follow-up steps: health checks, Ansible configuration, a Slack message. Kestra does not keep its own resource graph; state stays in the provisioner’s backend. What it adds is the workflow around the provisioner, with approvals, retries, secrets, and the logs of every run in one place. Teams comparing it with dedicated IaC runners can read our Spacelift alternatives guide.

Best for: platform and DevOps teams that run several IaC tools and scripts and want one governed, event-driven workflow for provisioning and day-2 operations. See Kestra for infrastructure automation.

2. OpenTofu: open-source declarative provisioning

OpenTofu provisions cloud, SaaS, and on-premises resources with HCL. It is hosted by the Linux Foundation and licensed under MPL-2.0. It was forked from the last MPL-licensed Terraform release, so existing HCL modules, state files, and providers keep working, and most teams switch by changing the binary.

OpenTofu has also added features of its own, such as client-side state encryption. By default, sensitive values written to resources end up in the state file in plain text; OpenTofu can encrypt the state with keys from AWS KMS, GCP KMS, or other key providers.

Like Terraform, OpenTofu is a CLI: it has no scheduler, UI, or approval system of its own, so teams run it from CI or from an orchestrator. For a detailed comparison of the two, see OpenTofu vs Terraform.

Best for: teams committed to HCL that want an OSI open-source, foundation-hosted engine.

3. HashiCorp Terraform: the HCL reference

Terraform, now part of IBM, made declarative HCL provisioning mainstream and remains widely used. It builds a dependency graph of resources, compares it with the state file, and applies the changes in order. Its provider registry covers nearly every cloud, network device, and SaaS platform, and HCP Terraform (formerly Terraform Cloud) adds hosted runs and a private module registry.

The trade-offs are licensing and operations. The BSL restricts using Terraform in products that compete with HashiCorp’s, and it is not an OSI open-source license. Without HCP Terraform, teams build their own pipelines for locking, drift checks with terraform plan -refresh-only, and controls around state. Our Terraform Cloud alternatives guide covers the hosted options.

Best for: enterprises already standardized on HashiCorp tooling and support contracts.

4. Pulumi: infrastructure in programming languages

Pulumi defines infrastructure in general-purpose languages: TypeScript, JavaScript, Python, Go, C#, Java, and YAML. Infrastructure definitions are programs, with loops, functions, classes, package managers such as npm or PyPI, and unit tests in the language’s usual frameworks.

The program registers resources with the Pulumi engine, which plans and applies changes and tracks them in state, much like Terraform. The CLI and SDKs are open source under Apache 2.0. State can live in Pulumi Cloud or in a self-managed backend such as an S3 bucket; Pulumi Cloud adds the team features (access control, audit history, policy enforcement). The flexibility has a cost: network calls or non-deterministic logic inside the program make runs harder to reproduce.

Best for: software-oriented platform teams that want reusable infrastructure components in the languages they already use.

Ready to orchestrate your infrastructure?

5. Crossplane: Kubernetes-native reconciliation

Crossplane turns a Kubernetes cluster into a control plane for external infrastructure. It is a CNCF graduated project and extends the Kubernetes API with custom resources that represent cloud services, such as an RDS database or a storage bucket.

Its model differs from CLI provisioners. With OpenTofu or Terraform, drift persists until the next run. Crossplane’s controllers reconcile continuously: when someone changes a managed resource by hand, Crossplane reverts it. Platform teams build Compositions, custom resources such as a “database” that bundles the instance, network, backups, and firewall rules, so application teams request infrastructure with a short manifest.

The trade-off is the Kubernetes dependency: without a cluster and the skills to run its controllers and CRDs, Crossplane is heavy for simple provisioning.

Best for: Kubernetes-centric teams building an internal platform on GitOps and continuous reconciliation.

6. Ansible: procedural configuration

Ansible is an agentless automation engine for configuration management, application deployment, and some provisioning. Its core is licensed under GPLv3. It connects over SSH to Linux and Unix hosts and over WinRM or PowerShell to Windows.

Playbooks are YAML lists of tasks run against inventory groups. Ansible is strongest at OS-level work: packages, configuration files, services, users, and hardening. Its collections also cover network devices, bare metal, and cloud APIs.

It is rarely the best choice for cloud topology. Ansible keeps no state of the resources it created, so removing a resource from a playbook does not delete it; teardown has to be written explicitly. That is why many teams pair OpenTofu or Terraform for provisioning with Ansible for configuration. Our Ansible alternatives guide covers other options.

Best for: operations teams that need agentless configuration, OS hardening, and patching across many hosts.

7. AWS CloudFormation: managed AWS stacks

CloudFormation is AWS’s managed IaC service. Templates are written in JSON or YAML, and AWS keeps the state and locking itself, so there is no state file to store or protect. Change sets preview modifications before they run, failed stack updates roll back, and drift detection and IAM integration are built in.

The limit is scope: CloudFormation provisions AWS resources. Third-party resource types exist through the CloudFormation Registry, but managing other clouds or SaaS this way is far less practical than with OpenTofu or Terraform providers.

Best for: teams running entirely on AWS that want managed state and no extra tooling.

IaC tools compared

ToolLanguageLicenseStateExecution modelBest for
KestraYAML workflowsApache 2.0 (Core)Delegated to the provisioner’s backendOrchestrated container tasksEnd-to-end provisioning and day-2 workflows
OpenTofuHCLMPL-2.0 (Linux Foundation)Remote state file, optional encryptionCLI run, dependency graphOpen-source multi-cloud provisioning
TerraformHCLBSL 1.1 (source-available)Remote state fileCLI run, dependency graphHashiCorp-standardized enterprises
PulumiTypeScript, Python, Go, C#, Java, YAMLApache 2.0Pulumi Cloud or self-managed backendProgram registers resources with an engineInfrastructure in general-purpose languages
CrossplaneKubernetes YAML (CRDs)Apache 2.0 (CNCF)Kubernetes API objectsContinuous reconciliationKubernetes-based internal platforms
AnsibleYAML playbooksGPLv3None (facts gathered at run time)Ordered tasks over SSH/WinRMServer configuration and patching
CloudFormationJSON / YAMLProprietary (AWS service)Managed by AWSService-side stack updatesAWS-only environments

Orchestrating IaC tools in delivery workflows

In production, an IaC run should follow the same steps every time: get the code, plan, have a person review the plan, apply exactly what was reviewed, then trigger what comes next. The flow below does this with OpenTofu. It saves the plan file, waits up to a day for approval, and applies that file; if nobody approves, the execution is cancelled and nothing changes.

id: opentofu-deployment-pipeline
namespace: platform.infrastructure
description: Plan with OpenTofu, wait for approval, then apply the reviewed plan.
tasks:
- id: plan_stage
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: clone_repo
type: io.kestra.plugin.git.Clone
url: https://github.com/your-org/infrastructure
branch: main
username: "{{ secret('GIT_USERNAME') }}"
password: "{{ secret('GIT_TOKEN') }}"
- id: plan
type: io.kestra.plugin.opentofu.cli.OpenTofuCLI
taskRunner:
type: io.kestra.plugin.scripts.runner.docker.Docker
containerImage: ghcr.io/opentofu/opentofu:1.9.0
env:
AWS_ACCESS_KEY_ID: "{{ secret('AWS_ACCESS_KEY_ID') }}"
AWS_SECRET_ACCESS_KEY: "{{ secret('AWS_SECRET_ACCESS_KEY') }}"
commands:
- tofu init -input=false
- tofu plan -input=false -out=tfplan
outputFiles:
- tfplan
- id: approval_gate
type: io.kestra.plugin.core.flow.Pause
pauseDuration: PT24H
behavior: CANCEL
- id: apply_stage
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: clone_again
type: io.kestra.plugin.git.Clone
url: https://github.com/your-org/infrastructure
branch: main
username: "{{ secret('GIT_USERNAME') }}"
password: "{{ secret('GIT_TOKEN') }}"
- id: apply
type: io.kestra.plugin.opentofu.cli.OpenTofuCLI
taskRunner:
type: io.kestra.plugin.scripts.runner.docker.Docker
containerImage: ghcr.io/opentofu/opentofu:1.9.0
env:
AWS_ACCESS_KEY_ID: "{{ secret('AWS_ACCESS_KEY_ID') }}"
AWS_SECRET_ACCESS_KEY: "{{ secret('AWS_SECRET_ACCESS_KEY') }}"
inputFiles:
tfplan: "{{ outputs.plan.outputFiles['tfplan'] }}"
commands:
- tofu init -input=false
- tofu apply -input=false tfplan

The point of the flow: the plan file produced before the pause is the one applied after it, so what the reviewer approved is exactly what changes. Credentials come from Kestra secrets, both stages use the OpenTofu task in a pinned container, and each run keeps the plan file and logs for audit.

Choosing the right IaC tool for your team

  • For platform and infrastructure teams: OpenTofu is the practical choice for an OSI open-source license without rewriting HCL modules. Run it with Ansible in Kestra to cover provisioning, configuration, approvals, and drift checks in one workflow.
  • For Kubernetes-based platform teams: Crossplane gives continuous reconciliation and GitOps. Kestra runs the steps around it that live outside the cluster, such as approvals, tests, and notifications.
  • For developer-led teams: if engineers want infrastructure in TypeScript or Python, Pulumi is the closest fit. Kestra schedules and gates Pulumi runs the same way it does OpenTofu plans.
  • For AWS-only teams: CloudFormation removes state management. Kestra still helps when a deployment spans CloudFormation stacks and steps outside AWS.
  • For small teams getting started: begin with OpenTofu and a remote, encrypted state backend, and use Kestra’s open-source edition once several people or environments need approvals and a shared history of runs.

Next steps for governed infrastructure automation

As infrastructure spreads across clouds, Kubernetes clusters, and on-premises systems, the hard part moves from writing code to governing its execution: secrets, approvals, state safety, and handoffs to configuration and delivery. Pair a declarative provisioner with an orchestration layer to keep environments reproducible and every change visible. Browse more infrastructure automation resources.

Terraform, Ansible and Kubernetes, orchestrated from one place.

Frequently asked questions

Find answers to your questions right here, and don't hesitate to Contact Us if you couldn't find what you're looking for.