Press ESC to close Press / to search

Terraform – Infrastructure as Code

Terraform is an infrastructure as code tool that enables you to define and provision data...

DevOps Tools Linux Open Source

Terraform is an infrastructure as code tool that enables you to define and provision data center infrastructure using a declarative configuration language. It supports multiple cloud providers and on-premises infrastructure.

Key Features

  • Multi-Cloud: Single workflow for any infrastructure
  • State Management: Track infrastructure changes
  • Module System: Reusable infrastructure components
  • Plan Command: Preview changes before applying
  • Provider Ecosystem: Hundreds of provider integrations

Installation

Install Terraform on Linux:

wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install terraform

Usage Examples

Define AWS infrastructure:

provider "aws" {
  region = "us-west-2"
}

resource "aws_instance" "web" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"
  
  tags = {
    Name = "WebServer"
  }
}

Benefits

Terraform brings software development practices to infrastructure. Version control, code review, and testing apply to your infrastructure, enabling reliable and repeatable deployments.

Download Terraform

Was this article helpful?