-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for exporting Azure resource identifier for azurerm_key_vault_certificate
#21261
Comments
hi @andyadamides is there any document or definition about the Azure resource manager ID for the KeyVault certificate? I find no such id from all APIs about certificates. |
It was very hard for me to find one, but the way I did it was:
|
Hi , i see that is now added which is great news, but the This is created in the same resource manager convention for other key vault secrets but cannot get it directly in any other way from the
Could you also add this one as it is needed for downstream role assignments? |
Hi @andyadamides could you use data-sources/key_vault_secret#resource_id to get the resource id of secret? |
But I cannot do this all in the same TF script: create a certificate using |
@wuxu92 wdyt? |
Hi @andyadamides could you please share an example configuration of your |
resource "azurerm_key_vault_certificate" "kv_certificate" {
name = module.naming_kv_certificate.result
key_vault_id = var.key_vault_resource_id
certificate_policy {
issuer_parameters {
name = var.issuer_parameters_issuer_name
}
key_properties {
exportable = true
key_size = 2048
key_type = "RSA"
reuse_key = true
}
lifetime_action {
action {
action_type = var.lifetime_action
}
trigger {
days_before_expiry = var.lifetime_action_days_before_expiry
}
}
secret_properties {
content_type = "application/x-pkcs12"
}
x509_certificate_properties {
extended_key_usage = ["1.3.6.1.5.5.7.3.1"]
key_usage = [
"cRLSign",
"dataEncipherment",
"digitalSignature",
"keyAgreement",
"keyCertSign",
"keyEncipherment",
"nonRepudiation",
]
subject_alternative_names {
dns_names = var.san_dns_names
}
subject = "CN=____"
validity_in_months = var.x509_cert_key_validity_months
}
}
} |
there is an empty secret field in the certificate by your configuration.. could you please create a new issue to describe your problem instead of continuning this thread? |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Is there an existing issue for this?
Community Note
Description
Currently
azurerm_key_vault_certificate
resource, does not support exporting the Azure resource id for a certificate that is in an Azure Key Vault. It only exports the HTTPS link for that certificate, i.e.https://<kv_name>.vault.azure.net/certificates/<cert_name>
.The Azure KV Certificate id is of this form:
/subscriptions/<sub_id>/resourceGroups/<rg_id>/providers/Microsoft.KeyVault/vaults/<kv_name>/certificates/<cert_name>
Not having the Azure certificate id can cause downstream issues such as when trying to do fine-grained individual IAM role assignments to the certificate level, since the
scope
inazurerm_role_assignment
does not support theHTTPS
format.New or Affected Resource(s)/Data Source(s)
azurerm_key_vault_certificate
Potential Terraform Configuration
References
No response
The text was updated successfully, but these errors were encountered: