Custom Terraform providers
The Shipped Terraform providers page lists the Terraform provider plug-ins that is shipped with the product. If the provider that you need is missing, then you can directly Bring Your Own (BYO) providers into the Terraform pod volume. The file naming convention for the binaries is as follows:
- For provider plug-in:
terraform-provider-<NAME>_vX.Y.Z
- For provisioner plug-in:
terraform-provisioner-<NAME>_vX.Y.Z
Terraform relies on file names to determine plug-in types, names, and versions.
Follow the below steps to copy the third-party Terraform provider to the cam-provider-terraform pods:
- Create an archive with plug-in or plug-ins. The archive is expanded in the
/home/terraform/.terraform.d/plugins/
folder on provider terraform pods when the pods are restarted.
Example of a plug-in archive that contains the ibm-cloud terraform plug-in:
unzip -l ibm_cloud_plugin.zip
Archive: ibm_cloud_plugin.zip
Length Date Time Name
--------- ---------- ----- ----
0 2021-10-12 13:34 registry.terraform.io/
0 2021-10-12 13:34 registry.terraform.io/ibm-cloud/
0 2021-10-12 13:34 registry.terraform.io/ibm-cloud/ibm/
0 2021-10-12 13:34 registry.terraform.io/ibm-cloud/ibm/1.33.1/
0 2021-10-12 13:36 registry.terraform.io/ibm-cloud/ibm/1.33.1/linux_amd64/
60833792 2021-10-01 09:08 registry.terraform.io/ibm-cloud/ibm/1.33.1/linux_amd64/terraform-provider-ibm_v1.33.1
5816 2021-10-01 09:13 registry.terraform.io/ibm-cloud/ibm/1.33.1/linux_amd64/README.md
88983 2021-10-01 09:13 registry.terraform.io/ibm-cloud/ibm/1.33.1/linux_amd64/CHANGELOG.md
15977 2021-10-01 09:13 registry.terraform.io/ibm-cloud/ibm/1.33.1/linux_amd64/LICENSE
--------- -------
60944568 9 files
When you upload this archive file by using the API and restart the pod, the terraform-provider-ibm_v1.33.1
binary is laid out under /home/terraform/.terraform.d/plugins/registry.terraform.io/ibm-cloud/ibm/1.33.1/linux_amd64
.
-
Use the Terraform file API to upload the plug-in archive.
-
Restart
cam-provider-terraform-api
pods. If you have enabled the isolation mode for Provider Terraform runtime during the installation, then you must restart thecam-provider-terraform-runtime
pods.
The location of the plug-in provider binary varies based on the Terraform version a provider plug-in supports:
Terraform version | Location of plugin provider binary |
---|---|
Terraform engine 0.12.x or lower | /home/terraform/.terraform.d/plugins/ |
Terraform engine 0.13.0 or higher and is listed in the Terraform official registry | /home/terraform/.terraform.d/plugins/registry.terraform.io/<namespace>/<type>/<version>/linux_<arch> |
Terraform engine 0.13.0 or higher and is provided by IBM Cloud Pak for Multicloud Management | /home/terraform/.terraform.d/plugins/registry.ibm.com/<namespace>/<type>/<version>/linux_<arch> |
Terraform engine 0.13.0 or higher and is built inhouse | /home/terraform/.terraform.d/plugins/<your.registry.com>/<namespace>/<type>/<version>/linux_<arch> |