This document assumes the use of Terraform 0.13 or later.
The Terraform Provider for VMware Aria Automation is a partner provider. Partner providers are owned and maintained by members of the HashiCorp Technology Partner Program. HashiCorp verifies the authenticity of the publisher and the providers are listed on the Terraform Registry with a Partner
label.
Providers listed on the Terraform Registry can be automatically downloaded when initializing a working directory with terraform init
. The Terraform configuration block is used to configure some behaviors of Terraform itself, such as the Terraform version and the required providers and versions.
Example: A Terraform configuration block.
terraform {
required_providers {
vra = {
source = "vmware/vra"
}
}
required_version = ">= 0.13"
}
You can use version
locking and operators to require specific versions of the provider.
Example: A Terraform configuration block with the provider versions.
terraform {
required_providers {
vra = {
source = "vmware/vra"
version = ">= x.y.z"
}
}
required_version = ">= 0.13"
}
To specify a particular provider version when installing released providers, see the Terrraform documentation on provider versioning.
To verify the initialization, navigate to the working directory for your Terraform configuration and run terraform init
. You should see a message indicating that Terraform has been successfully initialized and has installed the provider from the Terraform Registry.
Example: Initialize and Download the Provider.
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Finding vmware/vra versions matching ">= x.y.z" ...
- Installing vmware/vra x.y.z ...
- Installed vmware/vra x.y.z (signed by a HashiCorp partner, key ID *************)
...
Terraform has been successfully initialized!
The latest release of the provider can be found on the GitHub repository releases. You can download the appropriate version of the provider for your operating system using a command line shell or a browser.
This can be useful in environments that do not allow direct access to the Internet.
The following examples use Bash on Linux (x64).
-
On an a Linux operating system with Internet access, download the plugin from GitHub using the shell.
RELEASE=x.y.z wget -q https://github.com/vmware/terraform-provider-vra/releases/download/v${RELEASE}/terraform-provider-vra_${RELEASE}_linux_amd64.zip
-
Extract the plugin.
unzip terraform-provider-vra_${RELEASE}_linux_amd64.zip
-
Create a directory for the provider.
Note: The directory hierarchy that Terraform use to precisely determine the source of each provider it finds locally.
$PLUGIN_DIRECTORY/$SOURCEHOSTNAME/$SOURCENAMESPACE/$NAME/$VERSION/$OS_$ARCH/
mkdir -p ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/linux_amd64
-
Copy the extracted plugin to a target system and move to the Terraform plugins directory.
mv terraform-provider-vra_v${RELEASE} ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/linux_amd64
-
Verify the presence of the plugin in the Terraform plugins directory.
cd ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/linux_amd64 ls
The following example uses Bash (default) on macOS (Intel).
-
On a macOS operating system with Internet access, install wget with Homebrew.
brew install wget
-
Download the plugin from GitHub using the shell.
RELEASE=x.y.x wget -q https://github.com/vmware/terraform-provider-vra/releases/download/v${RELEASE}/terraform-provider-vra_${RELEASE}_darwin_amd64.zip
-
Extract the plugin.
tar xvf terraform-provider-vra_${RELEASE}_darwin_amd64.zip
-
Create a directory for the provider.
Note: The directory hierarchy that Terraform use to precisely determine the source of each provider it finds locally.
$PLUGIN_DIRECTORY/$SOURCEHOSTNAME/$SOURCENAMESPACE/$NAME/$VERSION/$OS_$ARCH/
mkdir -p ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/darwin_amd64
-
Copy the extracted plugin to a target system and move to the Terraform plugins directory.
mv terraform-provider-vra_v${RELEASE} ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/darwin_amd64
-
Verify the presence of the plugin in the Terraform plugins directory.
cd ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/darwin_amd64 ls
The following examples use PowerShell on Windows (x64).
-
On a Windows operating system with Internet access, download the plugin using the PowerShell.
$RELEASE="x.y.z" Invoke-WebRequest https://github.com/vmware/terraform-provider-vra/releases/download/v${RELEASE}/terraform-provider-vra_${RELEASE}_windows_amd64.zip -outfile terraform-provider-vra_${RELEASE}_windows_amd64.zip
-
Extract the plugin.
Expand-Archive terraform-provider-vra_${RELEASE}_windows_amd64.zip cd terraform-provider-vra_${RELEASE}_windows_amd64
-
Copy the extracted plugin to a target system and move to the Terraform plugins directory.
Note: The directory directory hierarchy that Terraform use to precisely determine the source of each provider it finds locally.
$PLUGIN_DIRECTORY/$SOURCEHOSTNAME/$SOURCENAMESPACE/$NAME/$VERSION/$OS_$ARCH/
New-Item $ENV:APPDATA\terraform.d\plugins\local\vmware\vra\${RELEASE}\ -Name "windows_amd64" -ItemType "directory" Move-Item terraform-provider-vra_v${RELEASE}.exe $ENV:APPDATA\terraform.d\plugins\local\vmware\vra\${RELEASE}\windows_amd64\terraform-provider-vra_v${RELEASE}.exe
-
Verify the presence of the plugin in the Terraform plugins directory.
cd $ENV:APPDATA\terraform.d\plugins\local\vmware\vra\${RELEASE}\windows_amd64 dir
A working directory can be initialized with providers that are installed locally on a system by using terraform init
. The Terraform configuration block is used to configure some behaviors of Terraform itself, such as the Terraform version and the required providers source and version.
Example: A Terraform configuration block.
terraform {
required_providers {
vra = {
source = "local/vmware/vra"
version = ">= x.y.z"
}
}
required_version = ">= 0.13"
}
To verify the initialization, navigate to the working directory for your Terraform configuration and run terraform init
. You should see a message indicating that Terraform has been successfully initialized and the installed version of the Terraform Provider for VMware Aria Automation.
Example: Initialize and Use a Manually Installed Provider
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Finding local/vmware/vra versions matching ">= x.y.x" ...
- Installing local/vmware/vra x.y.x ...
- Installed local/vmware/vra x.y.x (unauthenticated)
...
Terraform has been successfully initialized!
To find the provider version, navigate to the working directory of your Terraform configuration and run terraform version
. You should see a message indicating the provider version.
Example: Terraform Provider Version from the Terraform Registry
$ terraform version
Terraform x.y.z
on linux_amd64
+ provider registry.terraform.io/vmware/vra x.y.z
Example: Terraform Provider Version for a Manually Installed Provider
$ terraform version
Terraform x.y.z
on linux_amd64
+ provider local/vmware/vra x.y.z