Google Cloud: Installing and Configuring Terraform on a Compute Engine Instance

Share At:

Amazon Web Services: An Introduction to Terraform

In this tutorial we are going to learn how to install “Terraform” on a linux machine. For our demonstration purpose we will be using “google cloud compute instance” which will have “centos7” running.

Create a Compute Engine Instance

  1. From Google Cloud navigation, choose Compute Engine.
  2. In the main window pane, click Create.
  3. Name your instance instance-1.
  4. In the Boot disk section, click Change.
  5. Set Operating system to CentOS.
  6. Set Version to CentOS 7.
  7. Click Select.
  8. Click Create.

You will see a instance running:

Downloading and Installing Terraform

  1. Click SSH next to compute engine instance : instance-1 .
  2. Install necessary updates:

sudo yum update -ysudo yum install wget unzip -y

3. Download Terraform:

wget https://releases.hashicorp.com/terraform/0.12.23/terraform_0.12.23_linux_amd64.zip

  1. Unzip the file:

unzip terraform_0.12.23_linux_amd64.zip

5. Move Terraform to a directory called temp:

mkdir temp/

mv terraform temp/

6. Input the path to communicate with Terraform into the /etc profile file:

echo “PATH=’$PATH:~/temp/'” >> .bash_profile

7. Use the following in order to be able to call Terraform:

source .bash_profile

8. Call Terraform:

terraform

9. Check Terraform Version:

terraform -v

We are Done!!

Happy Learning !!!


Share At:
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Back To Top

Contact Us