Ansible manages server configuration. But who creates those servers? In the cloud you click in the console — and a month later you have no idea what you created or why. Terraform defines cloud infrastructure as code — declaratively, versioned, reproducibly.
Declarative approach¶
You describe the desired state — Terraform checks what exists (state file), compares it with the configuration and makes the necessary changes. Plan → Apply workflow.
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
key_name = "deploy-key"
tags = {
Name = "web-server"
Environment = "production"
}
}
resource "aws_security_group" "web" {
ingress {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}
Multi-provider¶
Terraform supports AWS, Azure, GCP, DigitalOcean, VMware and dozens of other providers. The same workflow for all clouds. Multi-cloud without vendor lock-in.
State management¶
The state file stores the mapping between configuration and real resources. Remote state (S3, Consul) for sharing within the team. State locking to prevent conflicts during parallel apply.
Terraform vs. CloudFormation¶
CloudFormation is AWS-only. Terraform is multi-provider. CF uses YAML/JSON, Terraform uses HCL (more readable). CF has better AWS integration (drift detection), Terraform offers greater flexibility.
Terraform is the foundation of cloud operations¶
Infrastructure in git, plan before apply, multi-cloud. Terraform is the best tool for provisioning cloud resources.
Need help with implementation?
Our experts can help with design, implementation, and operations. From architecture to production.
Contact us