I'm using Azure Key Vault, Git and DevOps Pipelines and my intention is to execute Terraform code against Oracle Cloud Infrastructure (OCI). I've configured the necessary resource group, storage account, container, uploaded the OCI provider variables into Key Vault.
I've tried storing the API signing key as a secret, and as a key, but Terraform throws provider-related errors regarding the private key. I'm looking for the proper way to get the content of the private key from Azure Key Vault and pass it to the OCI provider. Or just the proper way to leverage Key Vault with the OCI provider.
This is the error I'm getting during Terraform Plan:
Error: Incorrect attribute value type. Inappropriate value for attribute "private_key": string required.
My code looks as follows:
provider "oci" {
### Tenancy Connectivity variables
tenancy_ocid = "${data.azurerm_key_vault_secret.tenancy-ocid.value}"
user_ocid = "${data.azurerm_key_vault_secret.dev-user-ocid.value}"
fingerprint = "${data.azurerm_key_vault_secret.key-fprint.value}"
private_key = "${data.azurerm_key_vault_key.oci-private-key}"
private_key_password = ""
region = var.home_region
}
The Terraform Plan operation only seems to complain about the private key, while the other secrets are read successuflly. Any help would be appreciated!