Introduction to Terraform

Infrastructure as Code using Terraform

Anuj Syal
Lynx Data Engineering

--

Photo by Luca Bravo on Unsplash

Terraform is one of the most popular DevOps tools for IaC from HashiCorp. In a nutshell, it consists of managing a set of resources (computing, network, storage, etc.) using code.

Terraform allows you to automate infrastructure on any of the public cloud providers, and in this tutorial we will focus on using terraform with Google Cloud.

Step 1: Install Terraform

There are different options to install terraform dependent on the operating system

Ubuntu

Add the official HashiCorp repository to your system

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

Download the package information and install

sudo apt update
sudo apt-get install terraform

MacOs

Homebrew tap & Install

brew tap hashicorp/tap
brew install hashicorp/tap/terraform

Step 2: Verify the installation

terraform -help

Step 3: variables.tf

--

--