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 Virtual cloud servers by Cloud4Y? Not yet? 

 

Leave a request and get a 10-day free trial. 

 

Смотреть подробности   

 

  • 102 Users Found This Useful
Was this answer helpful?

Related Articles

How to check the vDC resources used/available

To view the resource limits allocated to your vDC, go to your vDC To view the vCPU and RAM, go...

Export and import vAPP directly from vCloud Director using OVFTool

OVFTool is a useful tool from VMWare, which allows users to directly import and export OVA/OVF...

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...

How to identify in which data center is my virtual infrastructure

Cloud4Y offers virtual infrastructure services in several datacenters simultaneously. You can...