terraform-provider-tfe icon indicating copy to clipboard operation
terraform-provider-tfe copied to clipboard

Tag still exists in UI even it is not being used on any workspaces

Open juicybaba opened this issue 3 years ago • 3 comments

Terraform Cloud/Enterprise version

v202205-01

Terraform version

1.1.9

Terraform Configuration Files

...

Debug Output

...

Expected Behavior

When a tag gets removed from all workspaces, that tag shouldn't be seen under filter and tag management. This is likely an issue of tfe product other than the provider, let me know if there is a dedicated place to report a product issue.

Actual Behavior

The tag can still be seen under filter (0 workspaces are using that tag) and tag management (it shows the tag is in use but I cant find related workspace, and I am the admin of the org) image image

Additional Context

juicybaba avatar Aug 08 '22 20:08 juicybaba

why can't you have a tag but not associate it with any workspace?

ausmartway avatar Aug 10 '22 07:08 ausmartway

why can't you have a tag but not associate it with any workspace?

@ausmartway thanks for the reply, there are 2 things,

  1. Creating a tag without associating workspace doesn't seem to be supported, I don't see a "create tag" button.
  2. According to the tag details(1st screenshot), there are still 31 instances (i guess instance means workspace) using "2022Apr" tag, but I can't find any workspace associated with "2022Apr" tag (2nd screenshot).

juicybaba avatar Aug 10 '22 15:08 juicybaba

@ausmartway any update for this ? or there is a better place for TFE platform?

juicybaba avatar Aug 27 '22 19:08 juicybaba

@ausmartway I think the tag will be created along with workspace creation, but it will not be removed even if all related workspaces are removed. not sure if this is a design thing for TFE tag full-lifecycle management or something can be fixed on provider level

juicybaba avatar Nov 02 '22 19:11 juicybaba

~Tags are not meant to be create-able or delete-able entities on the platform but we also don't delete them once they are unused by any workspace. You are right that this is an issue on the underlying platform, so I've added this as a feature request internally. I don't think a workaround/fix is possible in hashicorp/tfe.~

I spoke too soon! Organization tags are definitely manageable by the platform and there could be a resource in this provider that manages them. I've created a feature request here to track that feature request.

@juicybaba in the meantime, you can delete the tags that are no longer in use using the API or Organization settings UI.

brandonc avatar Dec 23 '22 22:12 brandonc