Installation and basic configuration of Terraform (CLI interface)

Terraform is a tool that provides the management of the vCloud Director cloud infrastructure from the command line. This article demonstrates the installation and initial configuration in CentOS 7, but it is the same for the vast majority of Linux. For a successful installation, you must have the wget and unzip utilities installed on your system.

First, let's update the system with a command:

sudo yum update

Next, let's install (check the installation) wget, unzip and the nano text editor with the command:

sudo yum install wget unzip nano

Then, download the latest (at the moment of writing 0.12.20) version of Terraform from the developer's website (https://www.terraform.io/downloads.html):

sudo wget https://releases.hashicorp.com/terraform/0.12.20/terraform_0.12.20_linux_amd64.zip

(note that this file is for the amd64 architecture)

 

Next step is unpacking:

sudo unzip ./terraform_0.12.20_linux_amd64.zip -d /usr/local/bin

Installation is over, check the correctness with the command:

terraform -v

If it's done right, you should see a version of Terraform

Next, you need to create a directory in which the working configuration will be located:

mkdir test

Let's go to the directory we created:

cd test

Terraform uses configuration files with .tf extension. Let's create and open a new configuration file:

sudo nano test.tf

Enter the minimum set of variables for successful connection:

 provider "vcd" {

  user = "your_login"

  password = "your_password"

  org = "organization name"

  url = "https://vcd.cloud4y.ru"

}

Save the configuration and try to connect:

terraform init

If it's done right, we get that answer:

You can now manage your organization's cloud infrastructure from the command line.

Have you tried Cloud4U cloud services? Not yet?

Go to the Main Website

Try for free

  • 102 Users Found This Useful
Was this answer helpful?

Related Articles

Virtual Machine Performance Graphs

Performance charts of virtual machines can be viewed in the HTML5 interface. To access the HTML5...

How to set up 2-factor (password +sms code) authorization in vCD

1. SETTING vCD   1. open https://idp.cloud4y.ru/idp/shibboleth and save the content as an XML...

Take advantages of two data centers

Ensuring service availability for customers is an important IT challenge. It can be provided at...

Loading OVF through vCloud Director

In this article, we will show you how to import your VMs through the internal interface of vCloud...

Configuring and Using vcd-cli (CLI Interface)

Manage your cloud infrastructure from a command line interface using vcd-cli To easily deploy...