Terraform is an open-source Infrastructure as a service (IaaC) tool, mainly used to provision and configure infrastructure in the various cloud platforms. It supports AWS, Microsoft Azure and GCP cloud platform. One of the main advantages of Terraform is, it does remember the previous state of the platform.
In this article, I will explain the installation of Terraform on Ubuntu 18 and Mac-book Pro.
Installation on Ubuntu
You can download the Terraform package from their website https://www.terraform.io/downloads.html or copy-paste below command directly on the Ubuntu terminal to download the package.
wget https://releases.hashicorp.com/terraform/0.12.12/terraform_0.12.12_linux_amd64.zip
Unzip the downloaded package and you will get a terraform binary file.
$ unzip terraform_0.12.12_linux_amd64.zip
Archive: terraform_0.12.12_linux_amd64.zip
inflating: terraform
Now move the terraform to bin directory and add it to the PATH location
$ sudo mv terraform /usr/local/bin/ $ export PATH=$PATH:/terraform-path/
To confirm the installation just execute terraform command terminal and you will get output like below.
$ terraform --version Terraform v0.12.12
Installation on Mac-book Pro
To install on Mac access the below page and click on 64bit.
https://www.terraform.io/downloads.html
Once the download complete opens it with an archive utility. Now you will get a terraform binary file. Move the zip and binary to the new folder.
$ mkdir terra
$ mv terraform terra
$ ls
terraform terraform_0.12.12_darwin_amd64.zip
To execute this binary ( command) from any folder we need to add the path to the bash profile. For this open the bash_profile file with any editor and add the path.
$ vim ~/.bash_profile
export PATH=$PATH:/Users/techies/Downloads/terra
Make the changes based on your machine path. Save the file and execute the “source” command to take new values from the bash profile.
$ source ~/.bash_profile
Execute the below command to make sure that the installed terraform working as expected.
MacBook-Pro:~ $ terraform --version
Terraform v0.12.12
Yes, we have completed the Terraform installation on Ubuntu and the Mac-book Pro.