Create a GCP Connector for AutoStopping Rules
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
- Step 1: Overview
- Step 2: GCP Billing Export
- Step 3: Grant Permissions
- Step 4: Test Connection
- Next Steps
Before You Begin
Add a GCP Connector
Perform the following steps to add a GCP connector for AutoStopping Rules:
- In Cloud Costs, click New AutoStopping Rule.
- In AutoStopping Rules, select GCP. It is the cloud account in which your workloads are running that you want to manage using AutoStopping Rules.
- Click Connect to your GCP account drop-down list and then click New Connector.
Step 1: Overview
- 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.