Skip to Content

Terraform Setup
Available in v1.20.0+

Overview

ScaleOps provides a Terraform module to integrate with Google Cloud Billing and BigQuery.

Prerequisites

  • Terraform 1.0 or higher
  • Google Cloud CLI (gcloud)
  • Google Cloud project with appropriate permissions
  • Billing export setup (see our billing export setup guide)

Usage

For different setup scenarios and detailed explanations, see our Quick Setup guide.

Using ScaleOps managed service account

module "scaleops_cost_integration" { source = "https://scriptshelf.scaleops.com/google/cost/integrate.tf.tar.gz" project_id = "<PROJECT_ID>" dataset_name = "<DATASET_NAME>" service_account_email = "" }

Using self-managed service account

module "scaleops_cost_integration" { source = "https://scriptshelf.scaleops.com/google/cost/integrate.tf.tar.gz" project_id = "<PROJECT_ID>" dataset_name = "<DATASET_NAME>" create_service_account = true }

Download Module / Preview

Optional variables

VariableDescriptionDefault
aggregate_project_idProject for the ScaleOps aggregate tablesproject_id
aggregate_dataset_nameDataset for the ScaleOps aggregate tablesdataset_name

Set both to write the aggregate tables outside the billing export dataset. The module then creates that dataset in the billing dataset’s location and points the Helm values at it. Import the dataset into state first if it already exists.

Apply Helm Values

After running the script, apply the provided Helm values to your ScaleOps installation. The configuration will look like this:

cloudBillingIntegration: google: enabled: true projectId: <PROJECT_ID> datasetName: <DATASET_NAME> # serviceAccountCredentials: # Optional, if using existing service account.

For full Helm values reference, see the Advanced Setup.