Are there details regarding tagging and labelling in Google Cloud?
search cancel

Are there details regarding tagging and labelling in Google Cloud?

book

Article ID: 282753

calendar_today

Updated On:

Products

CloudHealth

Issue/Introduction

Tags are essentially pairs of user defined metadata made up of a name (key) and a value that are added to resources when they are created.

In AWS and Azure these are referred to as "Tags" whereas GCP refers to these as "Labels" apart from some network components where they are referenced as "Network Tags".

 

GCP has 3 different types of 'resource tagging':

  1. Tags (https://cloud.google.com/resource-manager/docs/tags/tags-overview) - provide a way to conditionally allow or deny policies based on whether a resource has a specific tag. Tags can be referenced in IAM policy bindings or Organization Policy constraints to grant conditional access to resources.
  2. Labels (https://cloud.google.com/compute/docs/labeling-resources) - can be used as queryable annotations for resources, but can't be used to set conditions on policies. Labels are arbitrary key:value pairs that are stored as part of the resource's metadata. You can use labels to organize your Google Cloud resources.
      • User Labels - edited by users
      • System Labels - added automatically by GCP
  3. Network Tags (https://cloud.google.com/vpc/docs/add-remove-network-tags) are simple strings, not keys and values, and don't offer any kind of access control. They are mainly used in Compute Engine VM instances to allow you to make firewall rules and routes applicable to specific VM instances or a set of instances.
      • You make a firewall rule applicable to specific instances by using target tags and source tags.
      • You make a route applicable to specific instances by using a tag.

 

The platform pulls only labels using API calls and data in the BigQuery Billing Export, network tags are available in the tags field in API responses. We're currently unable to pull tags.

When you tag resources in GCP, you should really be using Labels rather than Tags. Labels are the correct way of tagging resources -> much like how you tag AWS and Azure (GCP for some reason just use a different terminology).

When you view labels within the platform, we prefix GCP labels with "Label":

Screenshot