Create dynamic tag rules to tag your Google Cloud Platform (GCP) instances based on GCP metadata as collected by the GCP Connector. For each tag rule you’ll provide a search query with GCP instance information.
It's easy to get started! 1) Click Create Tag, 2) choose Dynamic tag type, 3) choose the Cloud Asset Search tag rule, 4) choose GCP cloud provider and 5) enter your query. Just start typing in the Query field and we’ll show you the GCP attributes you can search.
The syntax is different when writing queries for tag rules than when searching assets in the Assets list. Be sure to follow the syntax tips in the drop-down when writing your query.
Find GCP instances from us-east1 region:
gcp.compute.zone: us-east1*
Find GCP instances based on IPs (comma-separated list or range):
gcp.compute.publicIpAddress: [35.0.0.1
... 35.255.255.255]
gcp.compute.privateIpAddress: [10.98.16.46 ... 10.98.16.50]
Find GCP instances of standard machine type:
gcp.compute.machineType: `n1-standard-1`
Find GCP instances from specific network:
gcp.compute.network: gcp-qvsadev-vpc02
Find GCP instances from specific project ID:
gcp.compute.projectId: qvsa-dev
Find GCP instances from specific project number:
gcp.compute.projectNumber: 1035365309337