DEV Community

Cover image for 🌱 Terraform has competition. OpenTofu enters the game
Latchu@DevOps
Latchu@DevOps

Posted on • Edited on

🌱 Terraform has competition. OpenTofu enters the game

πŸ‘‹ New to Infrastructure as Code? Heard of Terraform and OpenTofu but not sure which one to use? Don’t worry β€” this post is for you!

Let’s break it down with a real-world example and explain why both exist, how they differ, and which one to pick.


πŸ” What Are These Tools?

Both Terraform and OpenTofu help you define your cloud infrastructure as code.

Instead of clicking around the AWS console, you can write code like this:

resource "aws_s3_bucket" "my_bucket" {
  bucket = "my-dev-bucket"
  acl    = "private"
}

Enter fullscreen mode Exit fullscreen mode

And BOOM πŸ’₯ β€” your bucket is created!

βœ… Terraform and OpenTofu use the same syntax
βœ… Both work with AWS, Azure, GCP, and more
βœ… Both manage your infrastructure automatically


πŸ“– Why OpenTofu Exists?

Terraform was 100% open-source β€” until 2023, when HashiCorp changed its license.

That new license (BSL) added restrictions on how Terraform could be used β€” especially for companies building tools on top of it.

So, the open-source community said:

"Let’s keep the freedom alive!" πŸš€

They forked Terraform v1.5, kept it open-source, and created πŸ‘‰ OpenTofu, now backed by the Linux Foundation.


πŸ§‘β€πŸ’» Beginner-Friendly Example

Let’s say you want to create a virtual server (EC2 instance) on AWS.

Here’s the code

provider "aws" {
  region = "us-east-1"
}

resource "aws_instance" "example" {
  ami           = "ami-0c55b159cbfafe1f0" # Amazon Linux 2
  instance_type = "t2.micro"
}

Enter fullscreen mode Exit fullscreen mode

You can run this code with:

  • terraform apply (if using Terraform)
  • tofu apply (if using OpenTofu)

πŸ’‘ The exact same code works in both tools!


βš™οΈ Key Differences (Simple Table)

Feature Terraform OpenTofu
License BSL (some restrictions) MPL (fully open-source)
Maintained By HashiCorp (a private company) Linux Foundation (community-led)
Code Syntax HCL (HashiCorp Configuration Language) HCL
Use Case Enterprise support, stable releases Open, community-driven, freedom

πŸ€” So Which One Should You Use?

βœ… Use Terraform if:

  • You're in a company already using it
  • You rely on official support from HashiCorp
  • You don’t need to build tools on top of Terraform

βœ… Use OpenTofu if:

  • You want a fully open-source IaC tool
  • You’re concerned about vendor lock-in
  • You support community-first projects

🧘 Summary

Terraform and OpenTofu are twins β€” they speak the same language, but are raised in different homes.
Choose the one that aligns with your values:

Freedom & Openness? OpenTofu.
Stability & Support? Terraform.


πŸ’¬ Are you using OpenTofu or Terraform in your projects?

Would you switch? Let’s chat in the comments below πŸ‘‡

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.