Terraform is an Infrastructure as Code (IaC) tool developed by HashiCorp that allows you to define, provision, and manage cloud infrastructure using a declarative configuration language.
✅ Declarative Syntax – You define what infrastructure you want, and Terraform figures out how to create it.
✅ Multi-Cloud Support – Works with AWS, Azure, Google Cloud, Kubernetes, and more.
✅ State Management – Tracks infrastructure changes via a state file (terraform.tfstate
).
✅ Plan & Apply Workflow – You can preview changes before applying them (terraform plan → terraform apply
).
✅ Reusable Modules – Create reusable templates for infrastructure.
1️⃣ Write Configuration
.tf
files using HashiCorp Configuration Language (HCL).resource "aws_instance" "example" {
ami = "ami-0abcdef1234567890"
instance_type = "t2.micro"
}
2️⃣ Initialize Terraform
terraform init
3️⃣ Plan Infrastructure Changes
terraform plan