kindly see the below code so far i found and worked on, my main concern is to Copy/Replicate/Populate a certificate from Existing Key Vault into newly created key vault. when i run this i got Error . Error: Invalid data source
on resources.tf line 98, in data "azurerm_key_vault_certificate" "Cert-Name": 98: data "azurerm_key_vault_certificate" "Cert-Name" {
The provider provider.azurerm does not support data source "azurerm_key_vault_certificate".
data "azurerm_key_vault" "existing" {
name = "Test1-KV"
resource_group_name = "Test1-RG"
}
data "azurerm_key_vault_certificate" "Cert-Name" {
name = "Cert-Name"
key_vault_id = data.azurerm_key_vault.existing.id
}
resource "azurerm_key_vault_certificate" "Cert-Name" {
name = "Cert-Name"
key_vault_id = azurerm_key_vault.New-KV.id
certificate_policy {
issuer_parameters {
name = "MyCompany CA"
}
key_properties {
exportable = true
key_size = 2048
key_type = "SHA-1"
reuse_key = true
}
secret_properties {
content_type = "application/x-pkcs12"
}
}
}
This issue was solved by @ydaetskcoR's comment, add it as the answer to close the question:
The azurerm_key_vault_certificate data
source was released with v2.14.0. The version of azurerm
is needed to be 2.14.0 or above.
As an example:
provider "azurerm" {
version = "= 2.14.0"
}
# ... other configuration ...
For more details about azurerm, see this document.