Terraform Provider Configuration

Starting from Terraform 0.13.0 a new hierarchical namespace for providers was introduced by Terraform. For more information on this refer to Terraform documentation. This new feature requires explicit source information for any providers that are not maintained by Hashicorp. Terraform 0.13.0 and above provides a new nested block required_providers inside the terraform configuration block to specify the provider source location. The value for source attribute is in the format <REGISTRY_HOST>/<NAMESPACE>/<PROVIDER_TYPE>

The starterlibrary provides the following templates that showcase how to use this new source syntax.

For the templates that use the IBM Cloud Pak for Multicloud Management Managed services provided Terraform providers, you must use the required_providers section as shown in the following sample.

terraform {
  required_version = ">= 0.13"

  required_providers {
    camc = {
      #Source attribute value is in format <REGISTRY_HOST>/<NAMESPACE>/<PROVIDER_TYPE>
      source  = "registry.ibm.com/cam/camc"
      version = "0.2.5"
    }
  }

}

The above sample defines the source location for IBM Cloud Pak for Multicloud Management Managed services provided CAMC Provider. The value registry.ibm.com/cam/camc assigned to attribute source refers to the location of provider binary which is packaged under $HOME/.terraform.d/plugins/registry.ibm.com/cam/camc in the cam-provider-terraform pod. The name registry.ibm.com/cam in the source value indicates that the provider is a IBM Cloud Pak for Multicloud Management Managed services provided provider. The value registry.ibm.com in the binary path refers to a local dummy non-existent domain to indicate that this provider is a local in-house provider.

For a different IBM Cloud Pak for Multicloud Management Managed services provided provider say UCD provider, you would change only the value for PROVIDER_TYPE as shown below.

terraform {
  required_version = ">= 0.13"

  required_providers {
    ucd = {
      #Source attribute value is in format <REGISTRY_HOST>/<NAMESPACE>/<PROVIDER_TYPE>
      source  = "registry.ibm.com/cam/ucd"
      version = "0.5.1"
    }
  }

}

Refer to Shipped Terraform providers for complete set of provider binaries (which are compatiable with Terraform 0.13.0 or higher) bundled with IBM Cloud Pak for Multicloud Management Managed services.