Set Up Cloud Cost Management for GCP

Updated 1 week ago by Archana Singh

Harness Cloud Cost Management (CCM) monitors the cloud costs of your GCP products, projects, SKUs, and location. As a first step, you connect Harness to your GCP account to get insights into your cloud infrastructure and GCP services, Compute Engine Cloud Storage, BigQuery, etc. CCM displays the data for your connected GCP services for further analysis.

After enabling CCM, it takes about 24 hours for the data to be available for viewing and analysis.

In this topic:

Before You Begin

  • The same connector cannot be used in NextGen and FirstGen. For information on creating a GCP connector in the FirstGen see Set Up Cost Visibility for GCP.
  • Review Required permissions and roles to create an IAM role at the organization level
  • Ensure that you have the following permissions to enable and configure the export of Google Cloud billing data to a BigQuery dataset:

Connect Harness to Google Cloud Platform (GCP) Account

Connect Harness to your GCP account to get insights into your cloud infrastructure and GCP services, Compute Engine Cloud Storage, BigQuery, etc. This will give you cost insights that are derived from the billing export. For deep Kubernetes visibility and rightsizing recommendations based on the historical utilization and usage metrics, set up Kubernetes connectors. See Set Up Cloud Cost Management for Kubernetes.

Time periods in the GCP Cloud Billing report use the Pacific Time Zone (PST) and observe daylight saving time shifts. However, Harness CCM explorer uses the UTC time zone. You may notice some cloud cost differences between Harness CCM explorer and the GCP Cloud Billing report due to the time zone difference.

Step 1: Overview

  1. In Account Setup, in Account Resources, click Connectors.
  2. In Connectors, click + Connector.
  3. In Cloud Costs, click GCP.
  4. In Overview, in Connector Name, enter a name that describes this account.
  5. 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 Name.
    You need to enter Dataset Name 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 Name in Harness.
  10. Next, you need to enter the table name in Harness. From the GCP console, copy the table name where the billing export is available. In your BigQuery dataset, the table is named gcp_billing_export_v1_<BILLING_ACCOUNT_ID>.
    Enter the Table Name in Harness.
  11. 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.
  5. Click SHARE DATASET.
  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