Set Up Cloud Cost Management for GCP
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.
In this topic:
- Before You Begin
- Connect Harness to Google Cloud Platform (GCP) Account
- Step 1: Overview
- Step 2: GCP Billing Export
- Step 3: Grant Permissions
- Step 4: Test Connection
- Next Steps
Before You Begin
- 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:
- Billing Account Administrator role for the target Cloud Billing account
- BigQuery User role for the Cloud project that contains the BigQuery dataset that will be used to store the Cloud Billing data
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 involves the following steps:
Step 1: Overview
- In Account Setup, in Account Resources, click Connectors.
- In Connectors, click + Connector.
- In Cloud Costs, click GCP.
- In Overview, in Connector Name, enter a name that describes this account.
- 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.
- In GCP Billing Export, click Launch GCP console.
- 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.
- Click Create dataset. For more information, see Create a BigQuery dataset.
- Enter a Dataset ID.You need to enter Dataset ID in Harness.
- Select a Data location.
- Set the Default table expiration to Never.
- Set the Encryption option to Google-managed key.
- To save, click CREATE DATASET.
- 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.
- In Grant permissions, click Open BigQuery Page.
- Log into the GCP console and go to the BigQuery page.
- Select your project in the left panel.
- Select your dataset. For more information on creating a dataset, see Creating datasets.
- Click SHARE DATASET.
- 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.
- In Select a role, select BigQuery Data Viewer, and then click Add.
- Click Done.
When you are done, it will look something like this:
- 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.