Create a GCP Connector for AutoStopping Rules

Updated 3 months ago by Archana Singh

Currently, this feature is in Beta and behind Feature Flag. Contact Harness Support to enable the feature.

Connectors allow Harness to connect to your deployment environments, such as Kubernetes Clusters, AWS, Google Cloud Platform, Azure, etc. To create an AutoStopping Rule for your GCP instances, you first need to connect Harness to your GCP account.

This topic describes how to connect your GCP cloud account to Harness.

In this topic:

Before You Begin

Add a GCP Connector

Perform the following steps to add a GCP connector for AutoStopping Rules:

  1. In Cloud Costs, click New AutoStopping Rule.
  2. In AutoStopping Rules, select GCP. It is the cloud account in which your workloads are running that you want to manage using AutoStopping Rules.
  3. Click Connect to your GCP account drop-down list and then click New Connector.

Step 1: Overview

  1. In Overview, in Connector Name, enter a name that describes this account.
  2. In Specify Project ID, enter the project ID and click Continue. For more information on how to get a project ID, see Create a BigQuery dataset.

Step 2: GCP Billing Export

Cloud Billing export to BigQuery enables you to export detailed Google Cloud billing data (such as usage and cost estimate data) automatically throughout the day to a BigQuery dataset that you specify.

  1. In GCP Billing Export, click Launch GCP console.
  2. In the GCP Explorer window, in the pinned projects section, click your project ID to open the project. If you see an overflow menu (:) next to your project ID, click the menu and select Open.
  3. Click Create dataset. For more information, see Create a BigQuery dataset.
  4. Enter a Dataset ID.
    You need to enter Dataset ID in Harness.
  5. Select a Data location.
  6. Set the Default table expiration to Never.
  7. Set the Encryption option to Google-managed key.
  8. To save, click CREATE DATASET.
  9. Enter the Dataset ID in Harness and click Continue. When you are done it will look something like this:

Step 3: Grant Permissions

Cloud Billing Export to BigQuery helps you export detailed Google Cloud billing data (such as usage and cost estimate data) to a BigQuery dataset that you specify. The export happens throughout the day automatically. 

  1. In Grant permissions, click Open BigQuery Page.
  2. Log into the GCP console and go to the BigQuery page.
  3. Select your project in the left panel.
  4. Select your dataset. For more information on creating a dataset, see Creating datasets.
  6. In Dataset permissions, in Add members, enter the Harness service account as a member.

    Copy the service account detail from Harness. The service account is generated dynamically for your account.
  7. In Select a role, select BigQuery Data Viewer, and then click Add.
  8. Click Done.

    When you are done, it will look something like this:
  9. Click Continue in Harness.

Step 4: Test Connection

The validation and verification happen in this step. Once the validation and verification are completed, click Finish.

Your connector is now listed in the Connectors.

Next Steps

Please Provide Feedback