---
title: "Connect data through GCP"
slug: "connect-data-through-gcp"
updated: 2025-03-03T12:03:33Z
published: 2025-03-03T12:03:33Z
canonical: "docs.hunters.ai/connect-data-through-gcp"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hunters.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect data through GCP

Hunters allows you to connect data sources from different products through an intermediary Google Cloud Platform bucket.

This process is comprised of the following steps:

[STEP 1: Create a GCP service account](/v1/docs/connect-data-through-gcp#step-1-create-a-gcp-service-account) [STEP 2: Add key to service account](/v1/docs/connect-data-through-gcp#step-2-add-key-to-service-account) [STEP 3: Set up bucket access](/v1/docs/connect-data-through-gcp#step-3-set-up-bucket-access) [STEP 4: Provide information to Hunters](/v1/docs/connect-data-through-gcp#step-4-provide-information-to-hunters)

💡 Before you start

This process requires creating a service account and a bucket. They can be under different projects.

## STEP 1: Create a GCP service account

The first step is to create a GCP service account.

1. Navigate to **IAM & Admin > Service Accounts**. ![image.png](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/image%28101%29.png)
2. From the top menu, select **+ CREATE SERVICE ACCOUNT**. ![image.png](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/image%28102%29.png)
3. Choose a **name**, **ID**, and a helpful **description**, and click **DONE**. ![image.png](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/image%28103%29.png)

## STEP 2: Add key to service account

After creating your service account, we'll now need to add a key.

1. Click the menu icon of the service account and then click **Manage keys**. ![image.png](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/image%2899%29.png)
2. Click **ADD KEY** > **Create new key**. ![image.png](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/image%28100%29.png)
3. From the popup window, select **JSON** as the key type and click **CREATE**.

The one-time-only JSON key file will now be downloaded to your machine.

❗ IMPORTANT!

Keep this file safe where you can access it.

## STEP 3: Set up bucket access

Once you have the JSON key file, you can set up access to the GCP bucket.

1. Navigate to your Cloud Storage Buckets, and locate the bucket you want to share with Hunters. ![image.png](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/image%2896%29.png)
2. From the menu of the relevant bucket, select **Edit access**.

![image.png](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/image%2897%29.png)

The **Grant access** drawer opens.
3. Click **ADD PRINCIPAL** to open the **New Principals** field.
4. Open the JSON key file you downloaded in the previous steps, and copy the `client_email` value.
5. Paste the client email into the **New Principals** field.
6. Under **Assign roles**, search for the following roles and grant them:
  - Storage Object Viewer (roles/storage.objectViewer)
  - Storage Insights Collector Service (roles/storage.insightsCollectorService)

> [!NOTE]
> 📘Learn more
> 
> [Learn more](https://cloud.google.com/storage/docs/access-control/iam-roles?hl=en#standard-roles) about GCP IAM roles.
7. Click **Save**.

## STEP 4: Provide information to Hunters

1. On the Hunters platform, navigate to **Data > Data sources**.
2. Click **ADD DATA SOURCES**. ![image](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/Add%20data%20source%284%29.png)
3. From the integration tiles, locate the product you want to connect.
4. Click **Connect**.
5. Fill in the following fields:
  1. **Bucket project ID** - Enter the ID of the project where the bucket is located. **Note:** when the service account and the bucket are under the same project, this value will be identical to the `project_id` value in the JSON key file.
  2. **Bucket name** - Enter the bucket name.
  3. **Prefix(es)** - enter the path to the files you want to include. Note:
    - You can use `*` as a wildcard to match any character.
    - For efficiency, it's recommended to add a date partition, using the format `/{YYYY}/{MM}/{DD}`.
    - When using a date partition, you must specify all subdirectory levels before adding the date. For example: `/*/*/*/{YYYY}/{MM}/{DD}/`.
    - You can use date as a part of file, like: `/{YYYY}-{MM}-{DD}T{HH}*`
    - There is no need to add the bucket name as part of the path.
6. Under step 2, fill in the required fields based on the information in the **JSON key file** downloaded in [STEP 2](/v1/docs/connect-data-through-gcp#step-2-add-key-to-service-account). -- OR -- Upload the JSON file to auto-complete the fields.

> [!NOTE]
> 📘 About the JSON Key file
> 
> Your JSON key file should look like this:
> 
> ```plaintext
> {
>   "type": "service_account",
>   "project_id": "hunters",
>   "private_key_id": "96aaxxxxxxxxxxxxxxxxxxx10",
>   "private_key": "-----BEGIN PRIVATE KEY-----\nMII...<REDACTED>...wg\n-----END PRIVATE KEY-----\n",
>   "client_email": "hunters@hunters.iam.gserviceaccount.com",
>   "client_id": "105143366655555555530",
>   "auth_uri": "https://accounts.google.com/o/oauth2/auth",
>   "token_uri": "https://oauth2.googleapis.com/token",
>   "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
>   "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/hunters%40hunters.iam.gserviceaccount.com",
>   "universe_domain": "googleapis.com"
> }
> ```
> 
> Use the values in this file to fill in the connection field on Hunters.
7. Click **Test Connection** and then **Apply** to finish.

> [!NOTE]
> 💡If your bucket is vendor-hosted
> 
> If your GCP bucket is owned and managed by a vendor, you’ll need to perform the following steps:
> 
> 1. Perform [STEP 1](/v1/docs/connect-data-through-gcp#step-1-create-a-gcp-service-account) and [STEP 2](/v1/docs/connect-data-through-gcp#step-2-add-key-to-service-account).
> 2. Contact your vendor and ask them to provide you with:
>   - The bucket name
>   - The bucket project ID
>   - The required roles (mentioned in [STEP 3](/v1/docs/connect-data-through-gcp#step-3-set-up-bucket-access)) to your service account.
> 3. Perform [STEP 4](/v1/docs/connect-data-through-gcp#step-4-provide-information-to-hunters).
