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. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.
Description
Currently the google_data_catalog_policy_tag module seems to be able to create and delete a policy tag only.
It should be able to rename a policy tag as well, since this feature is available via GCP console.
While recreating a policy tag with the new name might seem like a solution/workaround, but it is not. Recreating a policy tag will remove the older policy tag, thus making all the bigquery table columns which was tagged with the older policy tag orphaned. In some scenarios, the number of such tables is huge (1000s) - finding all sch columns and tables and re adding the new policy tag to all of them is a mammoth task.
Adding the name field as user provided argument will provide an opportunity to identify the policy tag. The display_name argument then can be used to set/modify the display name of the policy tag, thus renaming it.
resource "google_data_catalog_policy_tag" "basic_policy_tag" {
taxonomy = google_data_catalog_taxonomy.my_taxonomy.id
display_name = "Low security"
name = "projects/{project}/locations/{region}/taxonomies/{taxonomy}/policyTags/{policytag}"
description = "A policy tag normally associated with low security items"
}
The API documentation doesn't indicate this field can be updated, so I'm marking this as a feature request. (The Cloud Console can sometimes take actions not supported by the API.)
Community Note
Description
Currently the google_data_catalog_policy_tag module seems to be able to create and delete a policy tag only. It should be able to rename a policy tag as well, since this feature is available via GCP console.
While recreating a policy tag with the new name might seem like a solution/workaround, but it is not. Recreating a policy tag will remove the older policy tag, thus making all the bigquery table columns which was tagged with the older policy tag orphaned. In some scenarios, the number of such tables is huge (1000s) - finding all sch columns and tables and re adding the new policy tag to all of them is a mammoth task.
New or Affected Resource(s)
* google_data_catalog_policy_tag
Potential Terraform Configuration
Adding the name field as user provided argument will provide an opportunity to identify the policy tag. The display_name argument then can be used to set/modify the display name of the policy tag, thus renaming it.
References
b/321386125