Simple guide to install TERRAFORM on Linux
We have seen a tremendous increase in demand for automation in the IT industry & IaaC, Infrastructure as a Code is a must-needed skill to possess. There are a number of tools available for Automation/IaaC & Terraform is one such tool.
Terraform is a great tool for automating our infrastructure by converting all our infrastructure as code. We can deploy resources using only the terraform scripts. The great thing about terraform is that it supports almost all cloud providers like AWS, GCP, Azure, IBM Cloud, etc & also supports in-house solutions.
So why do we need to use Terraform?
• With the help of terraform’s configuration file, we can provision a single machine or a complete data center. Not only can provision instances, but we can also make changes related to networking, DNS, SaaS, etc.
• Terraform recognizes incremental changes, so we don’t need to make incremental changes separately, edit the existing configuration file & run the commands. It will identify the incremental changes & will then provision them.
• A single tool can make changes to a number of service providers, so no need to learn cloud formation, Google cloud deployment manager, etc.
In this tutorial, we will learn how to install Terraform on Linux systems (Ubuntu, Debian, popOS, CentOS, RHEL, Fedora, etc).
Recommended Read: Guide to install Ansible on Ubuntu
Note:- Version 1.0.1 of the Terraform is now available in stable release & can be downloaded from the link HERE. The process for installation is the same as mentioned here.
So to install Terraform is pretty simple, we only need to have ‘wget’ installed on our systems to download the terraform package. Download the 64-bit package for Linux using the following command,
There are packages available for Windows, Mac, Solaris, etc & also 32 bit Linux packages HERE.
Once downloaded, unzip & move it to a separate directory,
$ unzip terraform_0.13.1_linux_amd64.zip
$ mkdir ~/App
$ mv terraform ~/App
Now the next thing is to set up the PATH for the terraform folder into our user’s bash profile ( ~/.bash_profile in CentOS/RHEL, ~/.profile in Debian/Ubuntu). To create the PATH entry, open the respective file & make the following entry into the file,
export PATH = “$PATH:~/App”
Now save the file & run the following command to implement the changes made to the file,
$ source ~/bash_profile
You can also log out & log back in to implement the changes. That’s it, we now have the terraform command installed & ready to use. To make sure that it is working fine, run the following command,
& we should get the following output,
That’s it for this tutorial on how to install Terraform on Linux machines. In our next tutorials, we will discuss about the commands that are used more frequently with terraform & also how we can create resources using terraform.
Originally Published at https://linuxtechlab.com/simple-guide-to-install-terraform-on-linux/
We are giving you exclusive deals to try Linux Servers for free with 100$ credit, check these links to claim your 100$,
Check some Exclusive Deals, HERE.
Also, check out DevOps Book You should read section.