← Back to blog
Infrastructure

Terraform Infrastructure as Code

Jun 25, 202510 min read

Infrastructure as Code (IaC) is a best practice for managing cloud resources.

What is Terraform?

Terraform is an open-source IaC tool that allows you to define infrastructure using declarative configuration files.

Benefits of IaC

  • Version control for infrastructure
  • Reproducible deployments
  • Infrastructure documentation
  • Team collaboration
  • Disaster recovery

Basic Terraform Workflow

  1. Write configuration files (.tf files)
  2. Initialize Terraform: terraform init
  3. Plan changes: terraform plan
  4. Apply changes: terraform apply

Example

resource "aws_instance" "web" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"

  tags = {
    Name = "web-server"
  }
}

Terraform makes infrastructure management predictable and scalable.

Written by

Sujata Dahal

← Back to all posts