DEV Community

Alex Spinov
Alex Spinov

Posted on

Terraform Has a Free Infrastructure-as-Code Tool — Manage Cloud Resources With Declarative Config

Clicking around in AWS console is fine for one server. Managing 50 servers, 10 databases, 5 load balancers, and 3 VPCs? You need infrastructure-as-code.

Terraform lets you define your entire cloud infrastructure in HCL files. Version it in git. Review changes in PRs. Apply with one command. Roll back if something breaks. Every major cloud provider is supported.

What You Get Free

BSL licensed (free for non-competing use):

  • Multi-cloud — AWS, GCP, Azure, DigitalOcean, Hetzner, Cloudflare, and 3,000+ providers
  • Declarative — describe WHAT you want, Terraform figures out HOW
  • State management — tracks what exists vs what's defined
  • Plan before apply — see changes before executing them
  • Modules — reusable infrastructure components
  • Import — bring existing resources under Terraform management
  • Workspaces — manage dev/staging/prod with same code
  • Community providers — 3,000+ providers in the registry

Quick Start

# main.tf
terraform {
  required_providers {
    hcloud = {
      source = "hetznercloud/hcloud"
    }
  }
}

provider "hcloud" {
  token = var.hcloud_token
}

resource "hcloud_server" "web" {
  name        = "web-server"
  server_type = "cx22"
  image       = "ubuntu-24.04"
  location    = "nbg1"
}

resource "hcloud_firewall" "web" {
  name = "web-firewall"
  rule {
    direction = "in"
    protocol  = "tcp"
    port      = "80"
    source_ips = ["0.0.0.0/0"]
  }
}
Enter fullscreen mode Exit fullscreen mode
terraform init    # Download providers
terraform plan    # Preview changes
terraform apply   # Create resources
terraform destroy # Remove everything
Enter fullscreen mode Exit fullscreen mode

What You Can Build

1. Reproducible infrastructure — destroy and recreate entire environments.
2. Multi-cloud setup — AWS + Cloudflare + Hetzner in one config.
3. Dev/staging/prod — same code, different variables per environment.
4. Disaster recovery — rebuild entire infrastructure from code.
5. Compliance — audit infrastructure changes through git history.

OpenTofu — The Fork

When HashiCorp changed Terraform's license to BSL, the community forked it as OpenTofu (MPL licensed). If license matters to you, use OpenTofu — it's a drop-in replacement.


Need infrastructure automation? Email spinov001@gmail.com

More free tiers: 74+ Free APIs Every Developer Should Bookmark

Top comments (0)