Skip to content

What is Terraform

Key idea:

Terraform — Infrastructure as Code tool from HashiCorp (2014). You declare desired state of cloud resources in HCL (HashiCorp Configuration Language), terraform apply creates/updates. Supports AWS, GCP, Azure, Yandex Cloud, Cloudflare, GitHub — via 3000+ providers. August 2023: HashiCorp changed license from MPL to BSL (Business Source License) → community fork **OpenTofu** (Linux Foundation, 100% compatible).

Below: details, example, related terms, FAQ.

Details

  • HCL: JSON-like syntax for resource definitions
  • State file: tracks real resources (local or remote S3 + DynamoDB lock)
  • Providers: AWS, GCP, Cloudflare, GitHub, Vault, Helm — via terraform registry
  • Modules: reusable chunks (VPC module, K8s cluster module)
  • OpenTofu: fork after BSL — compatible, Linux Foundation

Example

# AWS EC2 instance
resource "aws_instance" "web" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t3.small"
  tags = { Name = "WebServer" }
}

# Remote state in S3
terraform {
  backend "s3" {
    bucket = "tfstate"
    key    = "prod/terraform.tfstate"
    region = "us-east-1"
  }
}

Related Terms

Learn more

Frequently Asked Questions

Terraform or OpenTofu?

OpenTofu: free, MPL license, Linux Foundation. Terraform: BSL (non-commercial ok, commercial vendors restricted). For most teams — OpenTofu safer long-term.

State management?

Remote backend mandatory for teams: S3 + DynamoDB (lock), Terraform Cloud, or gitlab-managed-terraform-state. Local state = race conditions.

Terraform vs Pulumi?

Pulumi — IaC in real programming languages (TS, Python, Go). Terraform — HCL DSL. Pulumi better for developers, Terraform for sysadmins.