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
STEP 2: Add key to service account
STEP 3: Set up bucket access
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

  2. From the top menu, select + CREATE SERVICE ACCOUNT.
    image.png

  3. Choose a name, ID, and a helpful description, and click DONE.
    image.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

  2. Click ADD KEY > Create new key.
    image.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

  2. From the menu of the relevant bucket, select Edit access.

    image.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)

      📘Learn more

      Learn more 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

  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.

    -- OR --

    Upload the JSON file to auto-complete the fields.

    📘 About the JSON Key file

    Your JSON key file should look like this:

    {
      "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.

💡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 and STEP 2.

  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) to your service account.

  3. Perform STEP 4.