🌍 What is Terraform?

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.


🚀 Key Features of Terraform

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.


🛠️ How Does Terraform Work?

1️⃣ Write Configuration

resource "aws_instance" "example" {
  ami           = "ami-0abcdef1234567890"
  instance_type = "t2.micro"
}

2️⃣ Initialize Terraform

terraform init

3️⃣ Plan Infrastructure Changes

terraform plan