-
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
- Wait for eventual consistency when deleting
#16073
Conversation
azurerm_resource_group
Account for eventual consistency when deletingazurerm_resource_group
- Wait for eventual consistency when deleting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from a slight change to the sleep and timeout this LGTM 🌻
return resourceGroupContainsItemsError(id.ResourceGroup, nestedResourceIds) | ||
} | ||
if len(nestedResourceIds) > 0 { | ||
time.Sleep(15 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time.Sleep(15 * time.Second) | |
time.Sleep(30 * time.Second) |
if val.ID != nil { | ||
nestedResourceIds = append(nestedResourceIds, *val.ID) | ||
// Resource groups sometimes hold on to resource information after the resources have been deleted. We'll retry this check to account for that eventual consistency. | ||
err = pluginsdk.Retry(time.Minute*5, func() *pluginsdk.RetryError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err = pluginsdk.Retry(time.Minute*5, func() *pluginsdk.RetryError { | |
err = pluginsdk.Retry(time.Minute*2, func() *pluginsdk.RetryError { |
This functionality has been released in v3.0.2 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
A new feature was added in 3.0 that checks to see if there are any resources being managed by a resource group before deleting that resource group. Unfortunately, it seems there is a bit of eventual consistency that causes the resource group to think those resources are still around when they have been deleted.
To fix that, we'll do that check a few times before we actually error out because the resources are still around.
Fixes #16069