Harvester Terraform Provider

Requirements

  • Terraform >= 0.13.x
  • Go 1.16 to build the provider plugin

Install the Provider

Option 1: Download and install the provider from the Terraform registry.

To install this provider, copy and paste this code into your Terraform configuration. Then, run terraform init.

Terraform 0.13+

  1. terraform {
  2. required_providers {
  3. harvester = {
  4. source = "harvester/harvester"
  5. version = "0.2.7"
  6. }
  7. }
  8. }
  9. provider "harvester" {
  10. # Configuration options
  11. }

For more details, please refer to the Harvester provider documentation.

Option 2: Build and install the provider manually.

Building the provider:

  • Clone the repository using the following command:

    1. git clone [email protected]:harvester/terraform-provider-harvester
  • Enter the provider directory and build the provider; this will build the provider and put the provider binary in ./bin. Use the following command:

    1. cd terraform-provider-harvester
    2. make

Installing the provider:

  • The expected location for the Harvester provider for the target platform within one of the local search directories is as follows:

    1. registry.terraform.io/harvester/harvester/0.2.7/linux_amd64/terraform-provider-harvester_v0.2.7
  • The default location for locally-installed providers will be one of the following, depending on the operating system under which you are running Terraform:

    • Windows: %APPDATA%\terraform.d\plugins
    • All other systems: ~/.terraform.d/plugins
  • Place the provider into the plugin directory as in the following example:

    1. version=0.2.7
    2. arch=linux_amd64
    3. terraform_harvester_provider_bin=./bin/terraform-provider-harvester
    4. terraform_harvester_provider_dir="${HOME}/.terraform.d/plugins/registry.terraform.io/harvester/harvester/${version}/${arch}/"
    5. mkdir -p "${terraform_harvester_provider_dir}"
    6. cp ${terraform_harvester_provider_bin} "${terraform_harvester_provider_dir}/terraform-provider-harvester_v${version}"}

Using the provider

After placing the provider into your plugins directory, run terraform init to initialize it. More information about provider-specific configuration options can be found on the docs directory