-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
azurerm_key_vault takes exactly 10 minutes to delete #26851
Comments
I'm not sure how the |
Hi @GraemeMeyerGT thanks for filing this issue. Actually, the key vault was deleted in 4 seconds as shown in the log: AzureRM will automatically purge the key vault if purge protection is not enabled. The purge operation takes about 10 minutes: |
Thanks @wuxu92, do you have any idea how to get it to delete faster? It's not clear to me why Terraform should trigger a 10 minute delete/purge, whilst the Azure Key Vault or the Azure Portal UI would do it whatever way is faster? (I'll admit, we're at the edge of my understanding of how KV works). |
@GraemeMeyerGT To speed up deletion by skipping the purge operation, set the provider feature
more details see provider features documentaion: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/features-block#purge_soft_deleted_certificates_on_destroy:~:text=The%20key_vault%20block%20supports%20the%20following%3A |
I see, thanks @wuxu92. I will close this issue |
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. |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)/Data Source(s)
azurerm_key_vault
Terraform Configuration Files
Description / Feedback
The
azurerm_key_vault
resource is taking an unusually long time to destroy, seemingly exactly 10 minutes according to Terraform. This seems implausible as Key Vaults typically destroy much faster. This behaviour suggests a potential bug in the AzureRM provider.Expected behaviour: The Key Vault should be destroyed in a reasonable amount of time, typically under three minutes.
Actual behaviour: The Key Vault destruction is taking exactly 10 minutes according to Terraform.
References
This seems likely to be related to the changes made in v3.106.0 or v3.107.0 (#26070 and #26199 respectively). I'm not familiar enough with Go to diagnose much further.I tried this Terraform configuration with 3.105.0 and it also took exactly 10 minutes to destroy the Key Vault, so it may not be related to these releases as I'd previously thought.I've collected a TRACE of the core + provider, redacted some values and uploaded here:
redacted_terraform_destroy_core_trace.zip
I created a PowerShell script to try to replicate the same creation and deletion operations using the Azure CLI so I could time it for a rough comparison, and the Azure CLI seems to be able to do the whole create --> delete --> done process in about 2 minutes:
The text was updated successfully, but these errors were encountered: