According to GCP Documentation for Tags: To delete a tag value, you must first remove it from all resources. A tag value that is still attached to a resource will not be deleted.
If you have numerous resources where this tag is used (across Buckets, BQ Datasets, VMs, IAM, etc.) it can be cumbersome to check every resource page to identify where this tag is used.
Is there a CLI command that lists all places where a tag value is used?
This is useful:
According to GCP Documentation for Tags: To delete a tag value, you must first remove it from all resources. A tag value that is still attached to a resource will not be deleted.
If you have numerous resources where this tag is used (across Buckets, BQ Datasets, VMs, IAM, etc.) it can be cumbersome to check every resource page to identify where this tag is used.
Is there a CLI command that lists all places where a tag value is used?
This is useful:
Use the CLI command below to show a list of Tags attached to a specific resource:
gcloud resource-manager tags bindings list --parent=//cloudresourcemanager.googleapis.com/projects/PROJECT_ID
As an expected result, it should only show the inherited key-tag value pairs that are under the projects, which is the tag value.
For additional information, you can check the gcloud resource-manager tags bindings list.
SOLUTION
Cloud Asset Inventory provides this functionality. To search for a sample tag value of "access", you can use below example or see documentation on how to construct a query.
gcloud asset search-all-resources --query="tagValues:access"
Notes:
--format="table(name,assetType,project)"
or some variation to limit the output.