Terraform uses declarative configuration to provision infrastructure.
Core concepts:
- Provider: Plugin that talks to a platform (AWS, GCP, Azure)
- Resource: Infrastructure object (EC2 instance, S3 bucket)
- State: Terraform's record of what exists
- Plan: Preview of changes before applying
provider "aws" {
region = "us-west-2"
}
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t3.micro"
}
Workflow: terraform init → terraform plan → terraform apply