Terraform — Infrastructure as Code tool от HashiCorp (2014). Пишете desired state cloud resources в HCL (HashiCorp Configuration Language), terraform apply creates/updates. Supports AWS, GCP, Azure, Yandex Cloud, Cloudflare, GitHub — через 3000+ providers. Август 2023: HashiCorp сменил license с MPL на BSL (Business Source License) → community fork **OpenTofu** (Linux Foundation, 100% compatible).
Ниже: подробности, пример, смежные термины, FAQ.
# AWS EC2 instance
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t3.small"
tags = { Name = "WebServer" }
}
# Remote state в S3
terraform {
backend "s3" {
bucket = "tfstate"
key = "prod/terraform.tfstate"
region = "us-east-1"
}
}OpenTofu: free, MPL license, Linux Foundation. Terraform: BSL (некоммерческим ok, commercial vendors restricted). Для most teams — OpenTofu safer long-term.
Remote backend обязателен для teams: S3 + DynamoDB (lock), Terraform Cloud, или gitlab-managed-terraform-state. Local state = race conditions.
Pulumi — IaC на real programming languages (TS, Python, Go). Terraform — HCL DSL. Pulumi better для developers, Terraform для sysadmins.