Infrastructure as CodeUsing Terraform Data Sources Effectively
Learn how to use Terraform data sources to query existing resources, look up AMIs, reference remote state, and build dynamic configurations. Complete.
Technology
The best alternatives to Terraform in 2026: OpenTofu, Pulumi, AWS CDK, CloudFormation, Bicep, Crossplane and Ansible, compared by language, state and license.
Looking for alternatives to Terraform? In 2026 the realistic options are OpenTofu (the open-source fork), Pulumi (general-purpose languages), AWS CDK and CloudFormation (AWS only), Azure Bicep (Azure only), Crossplane (Kubernetes control plane) and Ansible (configuration management that can also provision). This guide compares all seven, explains when each one is a better fit than Terraform, and links to the detailed head-to-head comparisons.
| Tool | Language | State model | License | Best for |
|---|---|---|---|---|
| Terraform | HCL (declarative) | State file in a local or remote backend | BSL 1.1 | Multi-cloud IaC with the largest provider ecosystem |
| OpenTofu | HCL (Terraform-compatible) | State file, optional client-side encryption | MPL 2.0 | Open-source, drop-in Terraform replacement |
| Pulumi | TypeScript, Python, Go, C#, Java, YAML | Pulumi Cloud or self-managed backend | Apache 2.0 | Developer teams who want real languages and unit tests |
| AWS CDK | TypeScript, Python, Java, C#, Go | CloudFormation stacks, managed by AWS | Apache 2.0 | AWS-only teams who prefer code over templates |
| CloudFormation | YAML / JSON (declarative) | Managed by AWS | AWS service | AWS-native IaC with no state to run |
| Azure Bicep | Bicep DSL (compiles to ARM JSON) | Tracked by Azure Resource Manager | MIT | Azure-only teams |
| Crossplane | Kubernetes YAML (CRDs, Compositions) | Kubernetes API, continuously reconciled | Apache 2.0 | Platform teams building self-service APIs on Kubernetes |
| Ansible | YAML playbooks (procedural) | Stateless | GPL-3.0 | Configuration management, plus some provisioning |
The right choice depends on three questions: do you need more than one cloud, who should own the state, and does your team want HCL or a general-purpose language? The sections below answer them tool by tool.
OpenTofu was forked from Terraform in 2023, after HashiCorp moved Terraform to the Business Source License, and is now maintained under the Linux Foundation with the MPL 2.0 license. It reads the same HCL and uses the same providers, served from its own OpenTofu provider registry, so most existing configurations and state files work unchanged. On top of that it adds features Terraform does not have, such as client-side state encryption and early variable evaluation.
Choose it when you want to keep your Terraform code and skills but need an open-source license. Start with Terraform vs OpenTofu (2026), then install OpenTofu and follow the migration guide.
Pulumi replaces HCL with general-purpose languages, so you get loops, functions, classes, package managers and the unit-testing frameworks your developers already use. Values marked as secrets are encrypted in Pulumi state, and many Pulumi providers are bridged from the Terraform providers, so cloud coverage is broad.
Choose it when your infrastructure is written by application developers who would rather not learn HCL. See Pulumi vs Terraform for the trade-offs.
The AWS Cloud Development Kit lets you define AWS resources in TypeScript, Python, Java, C# or Go and synthesizes them into CloudFormation templates. Its higher-level constructs ship sensible defaults and helper methods such as bucket.grantRead() that write the IAM policy for you. It only targets AWS.
Choose it when you are all-in on AWS and your team prefers code to templates. Compare the two in AWS CDK vs Terraform.
CloudFormation is AWS's native IaC service. AWS stores the stack state for you, rolls back failed updates automatically and has drift detection built in, so there is no backend, lock table or state file to manage. The cost is YAML/JSON templates and AWS-only coverage.
Choose it when you only use AWS and value operational simplicity over a richer language. Read CloudFormation vs Terraform (2026) or the three-way Terraform vs CloudFormation vs Pulumi breakdown.
Bicep is Microsoft's domain-specific language for Azure. It compiles to ARM templates, has no separate state file (Azure Resource Manager tracks what is deployed), and az deployment group what-if previews changes much like terraform plan. Like CloudFormation, it only manages one cloud.
Choose it when Azure is your only platform and you want first-party tooling from Microsoft.
Crossplane is a CNCF project that runs inside a Kubernetes cluster and manages cloud resources as Kubernetes custom resources. Instead of running plan and apply on demand, its controllers continuously reconcile real infrastructure back to the declared state, and Compositions let a platform team publish simple self-service APIs (for example, a "database" resource) on top of AWS, Azure or GCP.
Choose it when you already run Kubernetes, use GitOps tools such as Argo CD or Flux, and want continuous drift correction. You need a cluster to host it, which makes it heavy for small teams.
Ansible is agentless, uses YAML playbooks and keeps no state. It has modules for AWS, Azure and GCP, so it can provision resources, but without a state file or a plan step you have to handle drift and deletions yourself. Most teams use it next to Terraform rather than instead of it: Terraform builds the infrastructure, Ansible configures what runs on it.
Choose it when most of your work is configuring servers and applications. See Terraform vs Ansible and using Terraform and Ansible together.
Sometimes the question is not "which language" but "where do my runs happen". If you are happy with Terraform or OpenTofu code and want another way to run it than HCP Terraform (formerly Terraform Cloud):
plan and apply from pull request comments.If you stay on HCP Terraform, Terraform Cloud workspaces covers the setup.
Every comparison on the site is also listed on the comparisons hub.
The terms below trip up engineers daily. Each guide explains the difference and when to use which:
It depends on your needs. OpenTofu is the closest drop-in replacement (a community fork of Terraform with the same HCL syntax). Pulumi is best if your team prefers a general-purpose language like TypeScript or Python. AWS CDK, CloudFormation and Azure Bicep are strong single-cloud choices, and Crossplane suits platform teams on Kubernetes.
OpenTofu. It is licensed under MPL 2.0, governed by the Linux Foundation and compatible with Terraform's HCL, providers and state. Pulumi (Apache 2.0) and Crossplane (Apache 2.0) are also open source but use different languages and workflows.
OpenTofu is an open-source fork of Terraform created after HashiCorp moved Terraform to the BSL license. It is Terraform-compatible at the HCL and state level, so most configurations work with either. Read the full Terraform vs OpenTofu comparison.
They solve different problems and are often used together. Terraform provisions infrastructure (declarative, stateful); Ansible configures and manages servers (procedural, stateless). See Terraform vs Ansible.
Yes. Atlantis is open source and runs Terraform from pull requests on your own infrastructure, and any CI system can run terraform plan and apply against a remote backend with state locking.
Terraform's CLI is free to use under the BSL license. OpenTofu is fully open source under the MPL. Paid tiers (HCP Terraform) add collaboration, policy, and state-management features.
Infrastructure as CodeLearn how to use Terraform data sources to query existing resources, look up AMIs, reference remote state, and build dynamic configurations. Complete.
Cloud ComputingMaster multi-account AWS management with Terraform. Learn provider aliases, cross-account IAM roles, AWS Organizations integration, and production-ready.
Cloud ComputingLearn how to implement Terraform state locking with AWS DynamoDB to prevent concurrent modifications and state corruption. Complete setup guide with examples.
DevOpsLearn how to integrate Terraform with GitHub Actions for automated infrastructure deployments. Complete guide with workflows, best practices, and.