Terraform Alternatives: Pulumi, OpenTofu, CloudFormation

Best Terraform Alternatives: Pulumi vs OpenTofu vs CloudFormation

Terraform is the default infrastructure as code tool for many teams, but it is not the only option. Teams switch away from it for concrete reasons: licensing concerns after HashiCorp moved Terraform to the Business Source License in 2023, frustration with HCL’s limits, or simply wanting a tool that fits their cloud better. This guide compares three of the most credible Terraform alternatives: Pulumi, OpenTofu, and AWS CloudFormation.

Each one solves the same core problem (managing cloud resources as code) with a different philosophy. Below you will find what each tool does well, where it struggles, real syntax examples, and a side-by-side table to help you decide.

What to Look for in a Terraform Alternative

Before comparing the tools, it helps to know what actually matters when you pick one:

  • Language and expressiveness: Can you write clean, reusable code, or do you fight the DSL?
  • State management: How does the tool track what it created? State bugs are the most common source of IaC pain.
  • Multi-cloud support: Does it cover AWS, Azure, GCP, and more, or is it locked to one provider?
  • Licensing: Open source, or subject to a vendor-controlled license?
  • Ecosystem and community: Are there modules, examples, and answered questions when you get stuck?

Pulumi: Infrastructure as Code in Real Programming Languages

Pulumi’s core idea is simple: instead of learning a domain-specific language like HCL, you write infrastructure in TypeScript, Python, Go, .NET, or Java. That means loops, conditionals, functions, and package management all work the way you already know.

// Pulumi (TypeScript): create an S3 bucket
import * as aws from "@pulumi/aws";

const bucket = new aws.s3.Bucket("logs", {
  bucket: "my-logs-bucket",
});

Because it is real code, you can unit test infrastructure logic, share libraries through npm or PyPI, and reuse the same abstractions across projects without HCL’s contortions.

Where Pulumi shines

  • Familiar languages for software engineers; no new DSL to learn
  • Multi-cloud: AWS, Azure, GCP, Kubernetes, and more from one program
  • Rich provider library and strong secret management built in
  • Works well for teams that treat infrastructure as software

Where Pulumi falls short

  • Smaller community than Terraform, so fewer copy-pasteable examples exist
  • Pulumi Cloud is the default backend for state; self-hosting the state backend is possible but adds setup work
  • Teams used to declarative HCL may find imperative code harder to review as pure config

OpenTofu: The Open-Source Terraform Fork

OpenTofu is a fork of Terraform created by the community after the 2023 license change. It is now governed by the Linux Foundation and distributed under the MPL 2.0 license. If you know Terraform, you already know OpenTofu: it accepts the same HCL syntax, the same providers, and most existing Terraform modules.

# OpenTofu: same HCL you already know
resource "aws_s3_bucket" "logs" {
  bucket = "my-logs-bucket"
}

Migration from Terraform is usually straightforward: point your CI at the OpenTofu binary, import your existing state, and keep your modules. The project has been adding features Terraform never shipped, such as early variable and local evaluation, but its main selling point is continuity: Terraform workflows under a truly open license.

Where OpenTofu shines

  • Drop-in compatibility with Terraform configs, providers, and state
  • Fully open source under MPL 2.0 with neutral governance
  • Zero retraining for teams already fluent in HCL

Where OpenTofu falls short

  • Younger project, so the ecosystem is still catching up to Terraform’s module count
  • Enterprise support options are thinner than HashiCorp’s offering
  • You still live with HCL’s limitations; it is the same language by design

CloudFormation: AWS-Native and Battle-Tested

AWS CloudFormation is the native IaC service for AWS. You describe resources in YAML or JSON templates, and AWS provisions and manages them as a stack, handling state, rollback, and drift detection itself.

# CloudFormation (YAML): create an S3 bucket
Resources:
  LogsBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: my-logs-bucket

Because AWS runs it, there is no state file to manage and no separate tool to install. It also integrates with AWS tooling: CDK (which compiles TypeScript/Python into CloudFormation), Service Catalog, and StackSets for multi-account deployments.

Where CloudFormation shines

  • No state management; AWS owns the stack lifecycle and rollbacks
  • Deep integration with every AWS service, including brand-new ones on launch day
  • CDK lets you write in real languages while CloudFormation does the deployment

Where CloudFormation falls short

  • AWS only; it cannot manage GCP, Azure, or on-prem resources
  • Error messages and deployment failures can be slow and cryptic
  • Templates get verbose, and advanced logic is awkward in YAML/JSON

Terraform Alternatives Compared: Side by Side

Factor Pulumi OpenTofu CloudFormation
Language TypeScript, Python, Go, .NET, Java HCL YAML / JSON (or CDK languages)
License Open source (Apache 2.0) Open source (MPL 2.0) Proprietary, AWS service
Cloud support Multi-cloud Multi-cloud AWS only
State Pulumi Cloud or self-managed backend State files, like Terraform Managed by AWS
Learning curve for Terraform users Medium (new language) Near zero Low-medium (new template style)
Best fit Dev-heavy teams, complex logic Teams wanting Terraform without the license risk AWS-only shops

Which One Should You Choose?

Pick OpenTofu if your team already runs Terraform and the license change is your main concern. It preserves your investment in HCL modules and workflows while moving to neutral, open governance.

Pick Pulumi if your engineers think in code first. When infrastructure logic gets complex (dynamic naming, shared libraries, real testing), a general-purpose language beats HCL, and Pulumi covers every major cloud.

Pick CloudFormation if you run entirely on AWS and want the provider to own state, rollbacks, and service-day-one support. Pair it with CDK when templates grow too verbose.

Frequently Asked Questions

Is OpenTofu compatible with existing Terraform modules?

Yes. OpenTofu accepts the same HCL syntax and works with the same provider ecosystem, so most Terraform modules and configurations run without changes. Check module compatibility notes for edge cases.

Can Pulumi and CloudFormation be used together?

Yes. Pulumi has an AWS provider that can deploy CloudFormation stacks, and some teams use CDK-style constructs alongside CloudFormation for parts of their infrastructure.

Does switching from Terraform require rebuilding infrastructure?

No. All three tools can import existing resources into their state rather than recreating them, so you can adopt a new tool without downtime if you plan the migration.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.