Custom terraform providers

For the terraform provider binaries, you can directly Bring Your Own (BYO) providers into the terraform persistent volume.

Run the following command to copy the third party terraform provider from the master node to the cam-provider-terraform pod:

  kubectl cp -n services <provider-file-name> $(kubectl get -n services pods | grep cam-provider-terraform | awk '{print $1;}' | head -n 1):/home/terraform/.terraform.d/plugins/

In the kubectl command, provider-file-name is the name of the third party provider. As all cam-provider-terraform pods share the same Kubernetes PV, this command works in both single and multi-node scenarios.

Run the following command to change the third party Terraform provider owner so that it can be loaded by the Terraform engine in Cloud Automation Manager:

  kubectl exec -n services $(kubectl get -n services pods | grep cam-provider-terraform | awk '{print $1;}' | head -n 1) chown terraform:terraform /home/terraform/.terraform.d/plugins/<provider-file-name>

The second command returns only single id of pod. Use head -1 in the command for multiple replica, that is, whenever you want the command to return more than one pod_id.