> For the complete documentation index, see [llms.txt](https://docs.finops.softwareone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.finops.softwareone.com/system/data-sources/google-cloud-platform.md).

# Google Cloud Platform

This topic describes how to connect your Google Cloud Platform (GCP) account to SoftwareOne's FinOps for Cloud. When connecting your account, you will need to provide the billing data details, such as the dataset name and table name.

<figure><img src="https://756292039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6rFi99rib6iBPaHxldNx%2Fuploads%2Fgit-blob-0427c8c0d5c80eccd843d6c5495fd061939db31e%2Fffc_gcp.png?alt=media" alt=""><figcaption><p>Google Cloud data source</p></figcaption></figure>

### Enable billing export <a href="#enable-billing-export" id="enable-billing-export"></a>

To enable billing data export, see [Set up Cloud Billing data export to BigQuery](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-setup) in the Google documentation.

After you have enabled billing data export, a new table is displayed in your BigQuery project.

Note the names of the dataset and the table. You'll need these details when connecting your cloud account to FinOps for Cloud.

<figure><img src="https://756292039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6rFi99rib6iBPaHxldNx%2Fuploads%2Fgit-blob-a1d693ff26295c5cd6afbedc8e4ebfbc6699c572%2Fgcp_billingdata_export.png?alt=media" alt=""><figcaption><p>Billing export</p></figcaption></figure>

### Create a role for FinOps for Cloud <a href="#prepare-a-role-for-optscale" id="prepare-a-role-for-optscale"></a>

You can create a role using Google Cloud CLI or Google Cloud Console:

{% tabs %}
{% tab title="Google Cloud CLI" %}
To assign the role via [gcloud CLI](https://cloud.google.com/sdk/gcloud), run the following command:

```
gcloud iam roles create optscale_connection_role --project=hystaxcom --permissions=bigquery.jobs.create,bigquery.tables.getData,compute.addresses.list,\compute.addresses.setLabels,compute.disks.list,compute.disks.setLabels,compute.firewalls.list,compute.globalAddresses.list,compute.instances.list,compute.instances.setLabels,compute.images.list,compute.images.setLabels,compute.machineTypes.get,compute.machineTypes.list,compute.networks.list,compute.regions.list,compute.snapshots.list,compute.snapshots.setLabels,compute.zones.list,iam.serviceAccounts.list,monitoring.timeSeries.list,storage.buckets.get,storage.buckets.getIamPolicy,storage.buckets.list,storage.buckets.update
```

{% endtab %}

{% tab title="Google Cloud Console" %}

1. Sign in to the [Google Cloud console](https://console.cloud.google.com/welcome).
2. In the Search bar, enter **Roles**, and then on the [Roles page](https://console.cloud.google.com/iam-admin/roles), click **Create Role**.
3. Provide the role title and description.
4. Click **Add permissions** and add the following permissions to the created role:
   * bigquery.jobs.create
   * bigquery.tables.getData
   * compute.addresses.list
   * compute.addresses.setLabels
   * compute.disks.list
   * compute.disks.setLabels
   * compute.firewalls.list
   * compute.globalAddresses.list
   * compute.instances.list
   * compute.instances.setLabels
   * compute.images.list
   * compute.images.setLabels
   * compute.machineTypes.get
   * compute.machineTypes.list
   * compute.networks.list
   * compute.regions.list
   * compute.snapshots.list
   * compute.snapshots.setLabels
   * compute.zones.list
   * iam.serviceAccounts.list
   * monitoring.timeSeries.list
   * storage.buckets.get
   * storage.buckets.getIamPolicy
   * storage.buckets.list
   * storage.buckets.update
5. Click **Add**.
6. Click **Create**.
   {% endtab %}
   {% endtabs %}

### Create a service account <a href="#create-service-account" id="create-service-account"></a>

Learn about service accounts in the Google documentation: [Service accounts | IAM Documentation | Google Cloud](https://cloud.google.com/iam/docs/service-accounts).

To create a service account:

1. From your GCP console, select [Service Accounts ](https://console.cloud.google.com/iam-admin/serviceaccounts)in the left-hand menu and click **Create Service Account**.
2. Enter a service account name and optionally enter a description of the service account.
3. Select **Create and continue**.
4. Select the [role you created](#prepare-a-role-for-optscale) and click **Continue**.
5. Select **Done**.

### Generate an API key for your service account <a href="#generate-api-key-for-your-service-account" id="generate-api-key-for-your-service-account"></a>

To generate an API key for your service account:

1. Find your service account in the service accounts list and click its name to go to the service account details page.
2. Go to the **Keys** tab.
3. Select **Add key** > **Create new key**.

The service account API key will be downloaded as a JSON file. Use this file when connecting your cloud account to FinOps.

### Connect the data source in FinOps for Cloud <a href="#connect-data-source-in-optscale" id="connect-data-source-in-optscale"></a>

Use the newly downloaded service account credentials JSON file with the billing dataset details to connect your GCP cloud account. Next, click **Connect** to complete the setup.

<figure><img src="https://756292039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6rFi99rib6iBPaHxldNx%2Fuploads%2Fgit-blob-784bdc79d38f9238b9903dabcdddc5b984f45cb0%2FGCP.png?alt=media" alt=""><figcaption><p>Google Cloud data source</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.finops.softwareone.com/system/data-sources/google-cloud-platform.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
