'Is there a way to see all GCP Unlabelled resource?

My goal is to see all the unlabelled inventory so I can label them correctly and show it in cost tracking



Solution 1:[1]

Adding labels to all resources automatically is not possible, nevertheless, as other comment suggests, you could try to use Asset inventory for this purpose. You can also export this to a GCP bucket.

Solution 2:[2]

To show all unlabeled resources you can use filter in gcloud command,

For example for show all unlabeled disks

gcloud compute disks list --filter=-labels:*

For compute instances use:

cloud compute instances list --filter=-labels:*

Solution 3:[3]

Did not work for my on a Mac:

cloud compute instances list --filter=-labels:*

Did work for my on a Mac:

gcloud compute instances list --filter="-labels:*"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman
Solution 2 Jenya
Solution 3 Greg Ames