-
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
r/resource_group: feature flag for prevent_deletion_if_contains_resources
#12657
r/resource_group: feature flag for prevent_deletion_if_contains_resources
#12657
Conversation
f379e75
to
2cf09f0
Compare
Rebased on top of main |
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.
hi @magodo
Thanks for this PR - apologies for the delayed review here, I've wanted to spend some time digging into this to ensure the behaviour's what we expect.
I've taken a look through and left some comments inline - since I've rebased this PR anyway I'm going to push a commit to fix those and ask @jackofallops to take another look through, but I think that should enable us to ship this.
Thanks!
resource_group.delete_nested_items_during_deletion
prevent_deletion_if_contains_resources
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 👍
This functionality has been released in v2.72.0 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. |
This PR introduces a new feature block
resource_group
with a toggledelete_nested_items_during_deletion
(same name as thetemplate_deployment
), which by default isfalse
that only allows users to delete a resource group when it is empty.NOTE This PR makes the toggle to be
false
by default, which is a breaking change comparing to the current provider behavior. So we'd either merge it for v3.0, or make ittrue
by default.(Using the
ThreePointOh
internal toggle might cause miss changes for (e.g.) document when we switching to v3.0 in this case?)Fixes #1608
Test Result
Run a basic test for VM to ensure when this feature is disabled, the listing by resource group API returns empty list when all the resources inside the resource group are deleted prior to Terraform trying to delete this resource group.