You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
Currently changing the content of a Key Vault certificate re-creates the resource (documentation). This means it destroys the certifcate and creates it again with the new content. This can't be done if Purge Protection is enabled on the Key Vault, which is a best practice.
Terraform fails its operation in this case:
Therefore there should exist an option to simply update the content. Azure Portal supports this by creating a new version of the certificate:
New or Affected Resource(s)/Data Source(s)
azurerm_key_vault_certificate
Potential Terraform Configuration
resource"azurerm_key_vault_certificate""example" {
name="imported-cert"key_vault_id=azurerm_key_vault.example.idcreate_new_version=true// <- this could indicate to not re-create the tf resourcecertificate {
contents=filebase64("certificate-to-import.pfx")
password=""
}
}
References
No response
The text was updated successfully, but these errors were encountered:
We have the same issue , Terraform tries to destroy the existing certificate, when what we want to do is update a new version of the soon to be expired cert.
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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Is there an existing issue for this?
Community Note
Description
Currently changing the content of a Key Vault certificate re-creates the resource (documentation). This means it destroys the certifcate and creates it again with the new content. This can't be done if Purge Protection is enabled on the Key Vault, which is a best practice.
Terraform fails its operation in this case:
Therefore there should exist an option to simply update the content. Azure Portal supports this by creating a new version of the certificate:
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: