HomeGuidesAPI Reference
GuidesAPI ReferenceGitHubAirheads Developer CommunityLog In
Guides

Installing Terraform provider for UXI

Terraform is an open-source infrastructure as code (IaC) tool used for provisioning and managing cloud infrastructure resources across multiple cloud providers. For more information, refer to wikipedia. Terraform provides a HashiCorp Configuration Language (HCL) that allows developers and operations teams to define the desired state of their infrastructure as code.

Note: This installation is only for those who are already familiar with Terraform and use Terraform to manage their network and cloud infrastructure.

Installation
The latest release of the provider can be found on 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.

Install Scripts
See linux, windows, and macOS install scripts that will download the latest release of the provider and install it in the appropriate location for your operating system.

Then skip to Configure the Terraform Configuration Files to complete the steps.

Linux
The following examples use Bash on Linux (x64).

  1. On a Linux operating system with Internet access, download the plugin from GitHub using the shell.
RELEASE=x.y.z
wget -q https://github.com/aruba-uxi/terraform-provider-hpeuxi/releases/download/v${RELEASE}/terraform-provider-hpeuxi_${RELEASE}_linux_amd64.zip
  1. Extract the plugin.
unzip terraform-provider-hpeuxi_${RELEASE}_linux_amd64.zip -d terraform-provider-hpeuxi_${RELEASE}
  1. Create a directory for the provider.

Note

The directory hierarchy that Terraform uses to precisely determine the source of each provider it finds locally.

$PLUGIN_DIRECTORY/$SOURCEHOSTNAME/$SOURCENAMESPACE/$NAME/$VERSION/$OS_$ARCH/

mkdir -p ~/.local/share/terraform/plugins/registry.terraform.io/aruba-uxi/hpeuxi/${RELEASE}/linux_amd64
  1. Copy the extracted plugin to a target system and move to the Terraform plugins directory.
mv terraform-provider-hpeuxi_${RELEASE}/terraform-provider-hpeuxi_v${RELEASE} ~/.local/share/terraform/plugins/registry.terraform.io/aruba-uxi/hpeuxi/${RELEASE}/linux_amd64
  1. Verify the presence of the plugin in the Terraform plugins directory.
cd ~/.local/share/terraform/plugins/registry.terraform.io/aruba-uxi/hpeuxi/${RELEASE}/linux_amd64
ls

macOS
The following example uses Zsh (default) on macOS (Apple Silicon).

  1. On a macOS operating system with Internet access, install wget with Homebrew.
brew install wget
  1. Download the plugin from GitHub using the shell.
RELEASE=x.y.z
wget https://github.com/aruba-uxi/terraform-provider-hpeuxi/releases/download/v${RELEASE}/terraform-provider-hpeuxi_${RELEASE}_darwin_arm64.zip
  1. Extract the plugin.
unzip terraform-provider-hpeuxi_${RELEASE}_darwin_arm64.zip -d terraform-provider-hpeuxi_${RELEASE}
  1. Create a directory for the provider.

Note

The directory hierarchy that Terraform uses to precisely determine the source of each provider it finds locally.

$PLUGIN_DIRECTORY/$SOURCEHOSTNAME/$SOURCENAMESPACE/$NAME/$VERSION/$OS_$ARCH/

mkdir -p ~/.terraform.d/plugins/registry.terraform.io/aruba-uxi/hpeuxi/${RELEASE}/darwin_arm64
  1. Copy the extracted plugin to a target system and move to the Terraform plugins directory.
mv terraform-provider-hpeuxi_${RELEASE}/terraform-provider-hpeuxi_v${RELEASE} ~/.terraform.d/plugins/registry.terraform.io/aruba-uxi/hpeuxi/${RELEASE}/darwin_arm64
  1. Verify the presence of the plugin in the Terraform plugins directory.
cd ~/.terraform.d/plugins/registry.terraform.io/aruba-uxi/hpeuxi/${RELEASE}/darwin_arm64
ls

Windows
The following examples use PowerShell on Windows (x64).

  1. On a Windows operating system with Internet access, download the plugin using the PowerShell.
Set-Variable -Name "RELEASE" -Value "x.y.z"
Invoke-WebRequest https://github.com/aruba-uxi/terraform-provider-hpeuxi/releases/download/v${RELEASE}/terraform-provider-hpeuxi_${RELEASE}_windows_amd64.zip -outfile terraform-provider-hpeuxi_${RELEASE}_windows_amd64.zip
  1. Extract the plugin.
Expand-Archive terraform-provider-hpeuxi_${RELEASE}_windows_amd64.zip
cd terraform-provider-hpeuxi_${RELEASE}_windows_amd64
  1. Copy the extracted plugin to a target system and move to the Terraform plugins directory.

Note

The directory hierarchy that Terraform uses 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\registry.terraform.io\aruba-uxi\hpeuxi\${RELEASE}\ -Name "windows_amd64" -ItemType "directory"

Move-Item terraform-provider-hpeuxi_v${RELEASE}.exe $ENV:APPDATA\terraform.d\plugins\registry.terraform.io\aruba-uxi\hpeuxi\${RELEASE}\windows_amd64\terraform-provider-hpeuxi_v${RELEASE}.exe
  1. Verify the presence of the plugin in the Terraform plugins directory.
cd $ENV:APPDATA\terraform.d\plugins\registry.terraform.io\aruba-uxi\hpeuxi\${RELEASE}\windows_amd64
dir

Configure the Terraform Configuration Files

Create and edit the file using any of the built-in editors (you can also use your favorite editor) to create and save a file with a .tf extension into the same directly where you have moved the plugin:

nano uxi.tf

Copy the following contents in the file named 'uxi.tf'.

Example: A Terraform configuration block.

terraform {
  required_providers {
    hpeuxi = {
      source = "HewlettPackard/hpeuxi"
      version = "0.1.0-alpha.1"
    }
  }
}

provider "hpeuxi" {
  # Configuration options
}

Verify the Terraform Initialization of a Manually Installed Provider
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 HPE UXI.

Example: Initialize and Use a Manually Installed Provider

% terraform init

Initializing the backend...

Initializing provider plugins...
- Finding hewlettpackard/hpeuxi versions matching "0.1.0-alpha.1"...
- Installing hewlettpackard/hpeuxi v0.1.0-alpha.1...
- Installed hewlettpackard/hpeuxi v0.1.0-alpha.1 (self-signed, key ID D4B16F4F2C16B845)

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

Get the Provider Version
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 v1.7.5
on darwin_amd64
+ provider registry.terraform.io/hewlettpackard/hpeuxi v0.1.0-alpha.1

Your version of Terraform is out of date! The latest version
is 1.11.2. You can update by downloading from https://www.terraform.io/downloads.html