Skip to content
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: change provider feature flag prevent_deletion_if_contains_resources default to true #13777

Closed
katbyte opened this issue Oct 18, 2021 · 2 comments · Fixed by #15800

Comments

@katbyte
Copy link
Collaborator

katbyte commented Oct 18, 2021

Community Note

  • 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

The default behaviour of the Azure Platform (and Terraform today) when the deleting a Resource Group is to delete all of the items within this Resource Group.

Whilst this feature makes it easy to clean-up any resources - since resources can be provisioned outside of Terraform, it means that these Resources are untracked by Terraform - and so Terraform is unable to show these Resources in the Plan during the deletion of the Resource Group.

Terraform currently has a feature-flag for this behaviour available within the Features block today - which will check during the deletion of the Resource Group for any Resources within this Resource Group, and raise an error (stating these must be removed first) if any Resources are found. In v2.x versions of the Azure Provider this is disabled by default - however for v3.0 we intend to flip this default to be enabled by default.

New or Affected Resource(s)

  • azurerm_resource_group

Potential Terraform Configuration

To retain the existing behaviour the following can be used

provider "azurerm" {
  features {
    resource_group {
      prevent_deletion_if_contains_resources = false
    }
  }
}

References

@github-actions
Copy link

This functionality has been released in v3.0.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!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants