> For the complete documentation index, see [llms.txt](https://docs.cortex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cortex.io/ingesting-data-into-cortex/integrations/google/connecting-entities-to-google-cloud-platform.md).

# Connecting entities to Google Cloud Platform

{% hint style="info" %}
Cortex connects to many third-party vendors whose system interfaces frequently change. As a result, integration behavior or configuration steps may shift without notice. If you encounter unexpected issues, check with your system administrator or refer to the vendor's documentation for the most current information. Additionally, integration sync times vary and are subject to scheduling overrides and timing variance.
{% endhint %}

This article explains how to connect entities to GCP. For configuration instructions, see [Configuring the integration for Google Cloud Platform](/ingesting-data-into-cortex/integrations/google.md). For instructions on using the integration, see [Using the integration for Google Cloud Platform](/ingesting-data-into-cortex/integrations/google/using-the-integration-for-google-cloud-platform.md).

## Connecting an entity to GCP

Cortex gives you two ways to connect entities to Google Cloud: automatically or manually.&#x20;

Automatic connections rely on Cortex importing your Google Cloud resources and matching labels to discover dependencies, so entities stay up to date with little upkeep.&#x20;

Manual connections let you define ownership, infrastructure resources, dependencies, and SLOs directly in the entity descriptor, giving you more control when automatic discovery doesn't fit your setup.&#x20;

Most teams use a mix of both, depending on how consistently their Google Cloud resources are labeled.

### Automatically importing Google Cloud resources

{% hint style="warning" %}
This feature doesn't automatically import team entities. To import them, see [Adding team entities to Cortex](/ingesting-data-into-cortex/entities-overview/entities/adding-entities/teams.md#adding-team-entities-to-cortex).
{% endhint %}

1. From the main sidebar, click your avatar in the bottom-left corner.
2. Select **Settings**.
3. From the **Settings** menu, locate the **Workspace** section, then expand **Entities**.
4. Select the **General** tab.
5. In the **Entity settings** section, toggle on **Auto import from AWS, Azure, and/or Google Cloud**.<br>

   <div align="left" data-with-frame="true"><figure><img src="/files/b8RUGBfD12ve9zDsLJfe" alt="" width="375"><figcaption></figcaption></figure></div>

### Manually importing Google Cloud resources via entity descriptor

To explicitly connect an entity to GCP, add the `x-cortex-infra` block to the entity's YAML, specifying the resource's name, project ID, and type.

<table><thead><tr><th width="158.5234375">Field</th><th width="458.97265625">Description</th><th align="center">Required?</th></tr></thead><tbody><tr><td><code>resourceName</code></td><td>Name of the GCP resource. For functions, use the format <code>location/function</code>.</td><td align="center"><i class="fa-check">:check:</i></td></tr><tr><td><code>projectId</code></td><td>The GCP project ID the resource belongs to</td><td align="center"><i class="fa-check">:check:</i></td></tr><tr><td><code>resourceType</code></td><td>The resource type, e.g. <code>function</code>, <code>storage</code></td><td align="center"><i class="fa-check">:check:</i></td></tr></tbody></table>

**Example**

```yaml
x-cortex-infra:
  Google Cloud:
    resources:
      - resourceName: us-central1/send-invoice
        projectId: cortex-production
        resourceType: function
      - resourceName: cortex-invoice-exports
        projectId: cortex-production
        resourceType: storage
```

## Ownership and dependencies for Google Cloud entities

### Syncing ownership from Google Groups

Cortex can use Google Groups as an ownership provider, automatically syncing group memberships so entity ownership always reflects your current mailing lists.&#x20;

{% hint style="info" %}
Cortex runs this ownership sync for Google teams every day at 9 a.m. UTC.
{% endhint %}

To assign a Google Group as an owner in your entity descriptor, use the group's full email address:

<table><thead><tr><th width="179.23828125">Field</th><th width="422.453125">Description</th><th align="center">Required?</th></tr></thead><tbody><tr><td><code>type</code></td><td>Must be <code>group</code></td><td align="center"><i class="fa-check">:check:</i></td></tr><tr><td><code>name</code></td><td>The full Google Group email address</td><td align="center"><i class="fa-check">:check:</i></td></tr><tr><td><code>provider</code></td><td>Must be <code>GOOGLE</code></td><td align="center"><i class="fa-check">:check:</i></td></tr><tr><td><code>description</code></td><td>Free-text description of the owner</td><td align="center"><i class="fa-xmark">:xmark:</i></td></tr></tbody></table>

**Example**

```yaml
x-cortex-owners:
  - type: group
    name: checkout-team@cortex.io
    provider: GOOGLE
    description: Owns the checkout service and its dependencies
```

### Discovering dependencies automatically

By default, Cortex looks for a `service` label on your Google Cloud resources and matches its value against each entity's [Cortex tag](/ingesting-data-into-cortex/entities-overview/entities.md#cortex-tag) to automatically map dependencies. If needed, you can [customize the label key](/ingesting-data-into-cortex/integrations/google.md#step-2-configuring-the-integration-in-cortex) in Cortex.

If you'd rather define these dependencies explicitly, add an `x-cortex-dependency` block to your entity descriptor:

<table><thead><tr><th width="158.5234375">Field</th><th width="458.97265625">Description</th><th align="center">Required?</th></tr></thead><tbody><tr><td><code>key</code></td><td>The label key on the GCP resource to match against</td><td align="center"><i class="fa-check">:check:</i></td></tr><tr><td><code>value</code></td><td>The label value on the GCP resource to match against</td><td align="center"><i class="fa-check">:check:</i></td></tr></tbody></table>

**Example**

```yaml
x-cortex-dependency:
  gcp:
    labels:
      - key: service
        value: checkout-service
      - key: env
        value: production
```

### Connecting SLOs

Reference a Service Level Objective (SLO) from Google Cloud Observability by adding its project and service ID to the entity's descriptor:

<table><thead><tr><th width="158.5234375">Field</th><th width="458.97265625">Description</th><th align="center">Required?</th></tr></thead><tbody><tr><td><code>projectId</code></td><td>The GCP project ID the SLO belongs to</td><td align="center"><i class="fa-check">:check:</i></td></tr><tr><td><code>serviceId</code></td><td>The unique ID from the service's page in Google Cloud Observability</td><td align="center"><i class="fa-check">:check:</i></td></tr></tbody></table>

**Example**

```yaml
x-cortex-slos:
  gcp:
    - projectId: cortex-production
      serviceId: iLE2e4HvR_service-checkout
    - projectId: cortex-production
      serviceId: iLE2e4HvR_service-billing
```

Find the `serviceId` value as the Unique ID on the [service page in Google Cloud Observability](https://console.cloud.google.com/monitoring/services).
