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 = "<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
}Optional variables
| Variable | Description | Default |
|---|---|---|
aggregate_project_id | Project for the ScaleOps aggregate tables | project_id |
aggregate_dataset_name | Dataset for the ScaleOps aggregate tables | dataset_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: <SERVICE_ACCOUNT_CREDENTIALS> # Optional, if using existing service account.For full Helm values reference, see the Advanced Setup.