The Terraform Provider is a tool which enables operations such as create, update, and delete to manage infrastructure on vCloud Director.
The current document covers the following Terraform Provider topics:
VMware has a constant support to Terraform. To align with this support, VMware released a Terraform Provider Plugin for vCloud Director. But this new Terraform Provider Plugin has few advantages over the earlier released plugin such as,
Terraform Provider has been developed using Python and GO. It uses Client-Server model inside the hood where the client has been written using GO and the server has been written using Python language. The core reason to use two different languages is to make a bridge between Terraform and Pyvcloud API. Pyvcloud is the SDK developed by VMware and provides a medium to talk to vCloud Director. Terraform uses GO to communicate where Pyvcloud has been written in Python3.
We are using GRPC Protocol to handle the communication between GO client and Python server.
yum group install "Development Tools" -y
yum install wget zlib-devel sqlite-devel openssl openssl-devel -y
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
tar -xvf Python*
cd Python-3.6.4
./configure
make
make install
python3 --version // output --> Python 3.6.4
pip3.6 --version // output --> pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
cd /opt
wget https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz
tar -xvf go*
export PATH=/opt/go/bin:$PATH
export GOROOT=/opt/go
go version // output --> go version go1.9.4
wget https://releases.hashicorp.com/terraform/0.11.4/terraform_0.11.4_linux_amd64.zip
unzip terraform_0.11.4_linux_amd64.zip
sudo mv terraform /usr/local/bin/
terraform --version // output --> Terraform version: 0.11.4
It is a binary code written in GO and managed by VMware. This binary will be consumed by Terraform CLI. Terraform CLI uses this binary to maintain the infrastructure through vCloud Director. This GO binary is a pure abstraction to Terraform CLI for all the subsequent parts of the architecture. Internally, this binary sends GRPC requests as per the operation (create/update/read/delete) to the server and notify the user about the response received from the server.
To get the GO Binary, use the following command and put the binary in '/usr/local/bin/'
cd /usr/local/bin/
wget https://github.com/vmware/terraform-provider-vcloud-director/raw/master/builds/linux/terraform-provider-vcloud-director
chmod +x terraform-provider-vcloud-director
wget https://www.python.org/ftp/python/3.6.4/python-3.6.4-macosx10.6.pkg
Above command will download the Python 3.6 installer. Run the installer and follow the instructions to install Python 3.6. To check the current version of python, run the following command in terminal.
python3.6 --version // output --> 3.6.4
pip3.6 --version // output --> pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
wget https://dl.google.com/go/go1.10.darwin-amd64.pkg
Above command will download the Go installer. Run the installer and follow the instructions to install Go. To check the current version of go, run the following command in terminal.
go version // output --> go version go1.9.4 darwin/amd64
wget https://releases.hashicorp.com/terraform/0.11.4/terraform_0.11.4_darwin_amd64.zip
unzip terraform_0.11.4_darwin_amd64.zip
sudo mv terraform /usr/local/bin/
terraform --version // output --> Terraform version: 0.11.4
It is a binary code written in GO and managed by VMware. This binary will be consumed by Terraform CLI. Terraform CLI uses this binary to maintain the infrastructure through vCloud Director. This GO binary is a pure abstraction to Terraform CLI for all the subsequent parts of the architecture. Internally, this binary sends GRPC requests as per the operation (create/update/read/delete) to the server and notify the user about the response received from the server.
To get the GO Binary, use the following command and put the binary in '/usr/local/bin/'
cd /usr/local/bin/
wget https://github.com/vmware/terraform-provider-vcloud-director/raw/master/builds/mac/terraform-provider-vcloud-director
chmod +x terraform-provider-vcloud-director
Terraform Provider Plugin requires minimal versions of following packages,