-
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
azurerm_resource_group
delete fails because of lag in resource deletion
#16155
Comments
@sebader Thank you for submitting this! Sorry that the issue is still happening with the retry logic. We've been reaching to the Azure team about this and will update here if we got any feedback. Before that, you can temporarily opt out the |
This comment was marked as off-topic.
This comment was marked as off-topic.
@magodo I have have been able to reproduce. I think there is a negative cache keeping the previous resource for at least 30sec. So when the resource group is getting destroyed, the api still respond saying the previous resource is in the resource group. When using prevent_deletion_if_contains_resources = true why not adding a small wait / retry to let the cache to expire and then only fails if there is still some resources after the retry logic? in my config:
Note: my goal is indeed to prevent deletion if the resource group still contains resources. However due to this cache on the API layer, the job fails. In the above example I would have expected the job to succeed. error log:
|
@LaurentLesle We do have 10min to wait for the cache to be invalidated: terraform-provider-azurerm/internal/services/resource/resource_group_resource.go Line 134 in d70e6ea
|
@magodo -> I have that issue on 2.99.0. I can see the retry has been included in 3.4.0. Will re-test with latest version |
Community Note
Terraform (and AzureRM Provider) Version
azurerm 3.0.2
Affected Resource(s)
azurerm_resource_group
Expected Behaviour
deletion should work
Actual Behaviour
Related to
#16069
#16073
We have a couple of Private Endpoints in our resource group, all managed by Terraform. Terraform destroys the private endpoints but the NICs seem to take a bit longer to be deleted.
This should have helped but I guess the waiting period needs to be further extended
Steps to Reproduce
terraform apply
Important Factoids
References
@mbfrahry
The text was updated successfully, but these errors were encountered: