# Integrate a GCP organization or project

Apono offers GCP users a simple way to centralize cloud management through our platform. Through a single integration, you can manage multiple GCP services across various organizations and projects.

***

### Prerequisites

<table><thead><tr><th width="255">Item</th><th>Description</th></tr></thead><tbody><tr><td><strong>Apono Connector</strong></td><td>On-prem <a href="/pages/xPrzAcLGsoliEpPJuozp">connection</a> serving as a bridge between a Google Cloud instance and Apono</td></tr><tr><td><strong>Apono Premium</strong></td><td><a href="https://www.apono.io/pricing/">Apono plan</a> providing the most features and dedicated account support</td></tr><tr><td><strong>Google User Account</strong></td><td>User account with <a href="https://support.google.com/cloud/answer/7284057?hl=en">owner permissions</a></td></tr><tr><td><strong>Google Cloud Command Line Interface (Google Cloud CLI)</strong></td><td><a href="https://cloud.google.com/sdk/gcloud">Command-line interface</a> used to manage Google Cloud resources</td></tr><tr><td><strong>Google Cloud Information</strong></td><td><p>Information for your Google Cloud instance associated with the Apono connector<br><br><strong>Google-defined</strong>:</p><ul><li>(Organization) <a href="https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id">Organization ID</a></li><li><a href="https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects">Project ID</a></li></ul><p><strong>User-defined</strong></p><ul><li>Service Account Name</li></ul></td></tr></tbody></table>

***

### Associate BigQuery dataset permissions

Google BigQuery is a fast, scalable, secure, fully managed data warehouse service in the cloud, serving as a primary data store for vast datasets and analytic workloads.

To add this resource to your Google Project or Organization, you must create a custom role with BigQuery dataset permissions and assign the role to the service account for the Apono connector.

{% hint style="success" %}
The following instructions in this section use the Google Cloud CLI.

However, you can also [create a custom role](https://cloud.google.com/iam/docs/creating-custom-roles#creating) through the Google Console, and IAM client library, or the REST API. Additionally, you can [assign the custom role](https://cloud.google.com/iam/docs/granting-changing-revoking-access#iam-grant-single-role-console) to the Apono connector through the Google Console.
{% endhint %}

Follow these steps to associate the permissions through the Google Cloud CLI:

1. In your shell environment, log in to Google Cloud and enable the API.

   ```shell
   gcloud auth login
   gcloud services enable cloudresourcemanager.googleapis.com
   gcloud services enable iam.googleapis.com
   ```
2. Set the environment variables.

{% tabs %}
{% tab title="Project" %}

```sh
export GCP_PROJECT_ID=<GOOGLE_PROJECT_ID>
export SERVICE_ACCOUNT_NAME=<SERVICE_ACCOUNT_NAME>
```

{% endtab %}

{% tab title="Organization" %}

```sh
export GCP_ORGANIZATION_ID=<GOOGLE_ORGANIZATION_ID>
export GCP_PROJECT_ID=<GOOGLE_PROJECT_ID>
export SERVICE_ACCOUNT_NAME=<SERVICE_ACCOUNT_NAME>
```

{% endtab %}
{% endtabs %}

3. Create the custom role. Be sure to replace the placeholders (`<ROLE_ID>`, `<TITLE>`, and `<DESCRIPTION>`) with actual values of your choosing for the role ID, title, and description of the role.

{% tabs %}
{% tab title="Project" %}
{% code overflow="wrap" %}

```sh
gcloud iam roles create <ROLE_ID> --project=$GCP_PROJECT_ID --title="<TITLE>" --description="<DESCRIPTION>" --permissions=bigquery.datasets.get,bigquery.datasets.update,bigquery.datasets.getIamPolicy,bigquery.datasets.setIamPolicy --stage=ALPHA
```

{% endcode %}
{% endtab %}

{% tab title="Organization" %}

<pre class="language-sh" data-overflow="wrap"><code class="lang-sh"><strong>gcloud iam roles create &#x3C;ROLE_ID> --organization=$GCP_ORGANIZATION_ID --title="&#x3C;TITLE>" --description="&#x3C;DESCRIPTION>" --permissions=bigquery.datasets.get,bigquery.datasets.update,bigquery.datasets.getIamPolicy,bigquery.datasets.setIamPolicy --stage=ALPHA
</strong></code></pre>

{% endtab %}
{% endtabs %}

4. Using the role ID defined in the previous step, assign the custom role to the Apono connector service account.

{% tabs %}
{% tab title="Project" %}
{% code overflow="wrap" %}

```sh
gcloud projects add-iam-policy-binding $GCP_PROJECT_ID --member="serviceAccount:$SERVICE_ACCOUNT_NAME@$GCP_PROJECT_ID.iam.gserviceaccount.com" --role="projects/$GCP_PROJECT_ID/roles/<ROLD_ID>"
```

{% endcode %}
{% endtab %}

{% tab title="Organization" %}
{% code overflow="wrap" %}

```sh
gcloud organizations add-iam-policy-binding $GCP_ORGANIZATION_ID --member="serviceAccount:$SERVICE_ACCOUNT_NAME@$GCP_PROJECT_ID.iam.gserviceaccount.com" --role="organizations/$GCP_ORGANIZATION_ID/roles/<ROLE_ID>"
```

{% endcode %}
{% endtab %}
{% endtabs %}

***

### Enable the Cloud Asset API

To manage and monitor your cloud assets, you must enable the Cloud Asset API.

Follow these steps to enable this API:

1. In your shell environment, log in to Google Cloud and enable the API.

```shell
gcloud auth login
gcloud services enable cloudasset.googleapis.com --project=<GOOGLE_PROJECT_ID>
```

***

### Integrate with GCP

#### Organization

<figure><img src="/files/P8lptSiqDKjI5YluFmJ2" alt="" width="563"><figcaption><p>Google Organization environment option</p></figcaption></figure>

{% hint style="success" %}
You can also use the steps below to integrate with Apono using Terraform.

In step **10**, instead of clicking **Confirm**, follow the **Are you integrating with Apono using Terraform?** guidance.
{% endhint %}

Follow these steps to integrate Apono with your GCP organization:

1. On the [**Catalog**](https://app.apono.io/catalog?search=gcp) tab, click **GCP.** The **Connect Integrations Group** page appears.
2. Under **Discovery**, click **Google Organization**.
3. Click one or more resource types to sync with Apono.

{% hint style="info" %}
Apono automatically discovers and syncs all the instances in the environment. After syncing, you can manage [access flows](/docs/access-flows/access-flows.md) to these resources.
{% endhint %}

4. Click **Next**. The **Apono connector** section expands.
5. From the dropdown menu, select a connector. Choosing a connector links Apono to the roles available in the organization where the connector is located.

{% hint style="success" %}
If the desired connector is not listed, click **+ Add new connector** and follow the instructions for creating an [Apono connector](/docs/gcp-environment/apono-connector-for-gcp.md).
{% endhint %}

6. Click **Next**. The **Integration Config** section expands.
7. Define the **Integration Config** settings.

   <table><thead><tr><th width="183">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Integration Name</strong></td><td>Unique, alphanumeric, user-friendly name used to identify this integration when constructing an access flow</td></tr><tr><td><strong>Organization ID</strong></td><td><a href="https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id">GCP organization ID</a></td></tr></tbody></table>
8. Click **Next**. The **Get more with Apono** section expands.
9. Define the **Get more with Apono** settings.

   <table><thead><tr><th width="184">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Credential Rotation</strong></td><td>(Optional) Number of days after which the database credentials must be rotated<br><br>Learn more about the <a href="/pages/UsMtClaCM1SlvPsARUsM">Credentials Rotation Policy</a>.</td></tr><tr><td><strong>User cleanup after access is revoked (in days)</strong></td><td><p>(Optional) Defines the number of days after access has been revoked that the user should be deleted</p><p><br>Learn more about <a href="/pages/zJwQEG15iEhbPYg9hpqp">Periodic User Cleanup &#x26; Deletion</a>.</p></td></tr><tr><td><strong>Custom Access Details</strong></td><td>(Optional) Instructions explaining how to access this integration's resources<br><br>Upon accessing an integration, a message with these instructions will be displayed to end users in the User Portal. The message may include up to <strong>400 characters</strong>.<br><br>To view the message as it appears to end users, click <strong>Preview</strong>.</td></tr><tr><td><strong>Integration Owner</strong></td><td><p>(Optional) Fallback approver if no <a href="/pages/Ey4wuziyr2BzKYQnd5am">resource owner</a> is found<br><br>Follow these steps to define one or several integration owners:</p><ol><li>From the <strong>Attribute</strong> dropdown menu, select <strong>User</strong> or <strong>Group</strong> under the relevant identity provider (IdP) platform.</li><li>From the <strong>Value</strong> dropdown menu, select one or multiple users or groups.</li></ol><p><br><strong>NOTE</strong>: When <strong>Resource Owner</strong> is defined, an <strong>Integration Owner</strong> must be defined.</p></td></tr><tr><td><strong>Resource Owner</strong></td><td><p>(Optional) Group or role responsible for managing access approvals or rejections for the resource<br><br>Follow these steps to define one or several <a href="/pages/Ey4wuziyr2BzKYQnd5am">resource owners</a>:</p><ol><li>Enter a <strong>Key name</strong>. This value is the name of the tag created in your cloud environment.</li><li>From the <strong>Attribute</strong> dropdown menu, select an attribute under the IdP platform to which the key name is associated.<br><br>Apono will use the value associated with the key (tag) to identify the resource owner. When you update the membership of the group or role in your IdP platform, this change is also reflected in Apono.</li></ol><p><br><strong>NOTE</strong>: When this setting is defined, an <strong>Integration Owner</strong> must also be defined.</p></td></tr></tbody></table>
10. Click **Confirm**.

<details>

<summary>💡Are you integrating with Apono using Terraform?</summary>

If you want to integrate with Apono using Terraform, follow these steps instead of clicking **Confirm**:

1. At the top of the screen, click **View as Code**. A modal appears with the completed Terraform configuration code.
2. Click to copy the code.
3. Make any additional edits.
4. Deploy the code in your Terraform.

Refer to [Integration Config Metadata](https://docs.apono.io/metadata-for-integration-config/integration-metadata/gcp-organization) for more details about the schema definition.

</details>

After connecting your GCP organization to Apono, you will be redirected to the **Connected** tab to view your integrations. The new GCP integration will initialize once it completes its first data fetch. Upon completion, the integration will be marked **Active**.

Now that you have completed this integration, you can [create access flows](/docs/access-flows/access-flows.md) that grant permission to GCP organizational roles.

#### Project

<figure><img src="/files/wFpZup5RqSm5q6u7evHG" alt="" width="563"><figcaption><p>Google Project environment option</p></figcaption></figure>

{% hint style="info" %}
You can also use the steps below to integrate with Apono using Terraform.

In step **10**, instead of clicking **Confirm**, follow the **Are you integrating with Apono using Terraform?** guidance.
{% endhint %}

Follow these steps to integrate Apono with your GCP project:

1. On the [**Catalog**](https://app.apono.io/catalog?search=gcp) tab, click **GCP.** The **Connect Integrations Group** page appears.
2. Under **Discovery**, click **Google Project**.
3. Click one or more resource types to sync with Apono.

{% hint style="info" %}
Apono automatically discovers and syncs all the instances in the environment. After syncing, you can manage [access flows](/docs/access-flows/access-flows.md) to these resources.
{% endhint %}

4. Click **Next**. The **Apono connector** section expands.
5. From the dropdown menu, select a connector. Choosing a connector links Apono to the roles available in the organization where the connector is located.

{% hint style="success" %}
If the desired connector is not listed, click **+ Add new connector** and follow the instructions for creating an [Apono connector](/docs/gcp-environment/apono-connector-for-gcp.md).
{% endhint %}

6. Click **Next**. The **Integration Config** section expands.
7. Define the **Integration Config** settings.

   <table><thead><tr><th width="193">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Integration Name</strong></td><td>Unique, alphanumeric, user-friendly name used to identify this integration when constructing an access flow</td></tr><tr><td><strong>Project ID</strong></td><td><a href="https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects">GCP project ID</a></td></tr></tbody></table>
8. Click **Next**. The **Get more with Apono** section expands.
9. Define the **Get more with Apono** settings.

   <table><thead><tr><th width="193">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Custom Access Details</strong></td><td>(Optional) Instructions explaining how to access this integration's resources<br><br>Upon accessing an integration, a message with these instructions will be displayed to end users in the User Portal. The message may include up to <strong>400 characters</strong>.<br><br>To view the message as it appears to end users, click <strong>Preview</strong>.</td></tr><tr><td><strong>Integration Owner</strong></td><td><p>(Optional) Fallback approver if no <a href="/pages/Ey4wuziyr2BzKYQnd5am">resource owner</a> is found<br><br>Follow these steps to define one or several integration owners:</p><ol><li>From the <strong>Attribute</strong> dropdown menu, select <strong>User</strong> or <strong>Group</strong> under the relevant identity provider (IdP) platform.</li><li>From the <strong>Value</strong> dropdown menu, select one or multiple users or groups.</li></ol><p><br><strong>NOTE</strong>: When <strong>Resource Owner</strong> is defined, an <strong>Integration Owner</strong> must be defined.</p></td></tr><tr><td><strong>Resource Owner</strong></td><td><p>(Optional) Group or role responsible for managing access approvals or rejections for the resource<br><br>Follow these steps to define one or several <a href="/pages/Ey4wuziyr2BzKYQnd5am">resource owners</a>:</p><ol><li>Enter a <strong>Key name</strong>. This value is the name of the tag created in your cloud environment.</li><li>From the <strong>Attribute</strong> dropdown menu, select an attribute under the IdP platform to which the key name is associated.<br><br>Apono will use the value associated with the key (tag) to identify the resource owner. When you update the membership of the group or role in your IdP platform, this change is also reflected in Apono.</li></ol><p><br><strong>NOTE</strong>: When this setting is defined, an <strong>Integration Owner</strong> must also be defined.</p></td></tr></tbody></table>
10. Click **Confirm**.

<details>

<summary>💡Are you integrating with Apono using Terraform?</summary>

If you want to integrate with Apono using Terraform, follow these steps instead of clicking **Confirm**:

1. At the top of the screen, click **View as Code**. A modal appears with the completed Terraform configuration code.
2. Click to copy the code.
3. Make any additional edits.
4. Deploy the code in your Terraform.

Refer to [Integration Config Metadata](https://docs.apono.io/metadata-for-integration-config/integration-metadata/gcp-project) for more details about the schema definition.

</details>

After connecting your GCP project to Apono, you will be redirected to the **Connected** tab to view your integrations. The new GCP integration will initialize once it completes its first data fetch. Upon completion, the integration will be marked **Active**.

Now that you have completed this integration, you can [create access flows](/docs/access-flows/access-flows.md) that grant permission to GCP organizational roles.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.apono.io/docs/gcp-environment/gcp-integrations/integrate-a-gcp-organization-or-project.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
