Terraform is an open-source infrastructure automation tool created by HashiCorp. It’s written in the Go programming language. It allows you to define and describe your infrastructure as code inside configuration files using a declarative language and to deploy and manage that infrastructure across a variety of public cloud providers like AWS, GCP, Azure, etc.
The basic workflow when using Terraform is:
1. Write configuration files on your computer in which you declare the elements of your infrastructure that you want to create.
2. Tell Terraform to analyze your configurations and then create the corresponding infrastructure.
This tutorial will explain how to install Terraform on Ubuntu 18.04.
Terraform is very easy to install. You can download Terraform from the Terraform download page. Select the appropriate package for your operating system and architecture, unzip the archive and move the binary to a directory included in your PATH variable.
First, create ~/bin directory:
On Ubuntu, if you create this directory it will automatically be added to your PATH.
Next, download the zip archive. Visit the Terraform download page for the latest version to download.
Unzip the archive. The archive will extract a single binary called
terraform binary to a directory included in your system’s
PATH in our case that’s
mv terraform ~/bin
To check whether Terraform is installed, run:
terraform version # Terraform v0.12.24
The best place to learn how to use Terraform, deploy and manage your infrastructure is Terraform docs. There are a lot of providers you can manage with it.