What is Terraform?
Terraform is an open-source tool by HashiCorp that provisions infrastructure across many clouds using a single declarative language.
Terraform is an open-source Infrastructure as Code tool created by HashiCorp. You describe the infrastructure you want, and Terraform figures out the API calls needed to make reality match.
Declarative, not imperative
You do not write step-by-step instructions. You declare a desired end state ("I want one server and one database") and Terraform computes the difference between what exists and what you asked for.
Provider based
Terraform talks to each platform through a provider — a plugin for AWS, Azure, Google Cloud, Kubernetes, GitHub, and hundreds more. One workflow, many targets.
Example
# A complete, minimal Terraform configuration.
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}When to use it
- A platform team uses Terraform to provision AWS, Azure, and GCP resources from a single workflow, avoiding three separate CLI tools.
- A SaaS company uses Terraform's Atlantis integration to enforce that every infrastructure change gets a plan reviewed in GitHub before apply.
- An e-commerce firm uses the Terraform Registry's verified AWS modules to spin up RDS, ElastiCache, and ALB without writing boilerplate.
More examples
Terraform version check
Confirms Terraform is installed and shows the active provider plugins alongside the CLI version.
terraform version
# Terraform v1.9.0
# on linux_amd64
# + provider registry.terraform.io/hashicorp/aws v5.50.0Minimal AWS provider block
Declares the AWS provider with a version constraint — the minimum required to start writing AWS resources.
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}Multi-cloud resource overview
Demonstrates Terraform's multi-cloud capability by managing AWS S3 and GCS buckets in the same configuration.
provider "aws" { region = "us-east-1" }
provider "google" { project = "my-gcp-project"; region = "us-central1" }
resource "aws_s3_bucket" "assets" {
bucket = "my-app-assets"
}
resource "google_storage_bucket" "backup" {
name = "my-app-backup"
location = "US"
}
Discussion