Terraform is an open-source Infrastructure as Code (IaC) tool developed by
HashiCorp. It lets you define, provision, and manage cloud infrastructure (and even
on-prem systems) using simple, human-readable configuration files written in HCL
(HashiCorp Configuration Language).
Instead of manually creating servers, networks, or databases in AWS, Azure, GCP,
etc., you describe what you want in code, and Terraform figures out how to create
or update those resources.
---
🔑 Key Features of Terraform
1. Infrastructure as Code (IaC)
Write infrastructure in .tf files.
Example:
resource "aws_instance" "web" {
ami = "ami-12345678"
instance_type = "t2.micro"
}
2. Multi-Cloud & Provider Support
Works with AWS, Azure, GCP, Kubernetes, VMware, GitHub, Datadog, and many others.
3. Execution Plan (terraform plan)
Shows what changes will happen before applying them.
4. State Management
Keeps track of deployed resources in a state file, so it knows what exists and what
needs changing.
5. Immutable Infrastructure
Encourages replacing resources instead of manually modifying them, reducing drift.
6. Modules & Reusability
Lets you create reusable building blocks for your infrastructure.
---
🔄 Basic Workflow
1. Write → Define resources in .tf files.
2. Init → Run terraform init to initialize providers.
3. Plan → Run terraform plan to preview changes.
4. Apply → Run terraform apply to create/update infrastructure.
5. Destroy → Run terraform destroy to remove everything.
---
👉 In short: Terraform automates infrastructure management so you can reliably and
repeatedly create the same environment (dev, test, prod) across clouds.