Attribute GCP TF Deployment
Attribute provides a holistic platform for cloud cost, including the ability to understand cost attribution and accountability from the resource level up to the feature, application, team, and customer levels.
To achieve this, Attribute requires several levels of access:
- Access to billing information.
- Attribute sensor implementation, to gain resource utilization information.
Below are the detailed steps and permissions required to complete the installation.
Depending on your cloud implementation, additional permissions may be required for specific resources.
Billing Export Data
Attribute uses GCP's detailed billing export to load the current billing and usage information for your organization. Configure the Billing Export with the following steps:
- Access the billing dashboard by selecting Billing in the console's navigation panel.
- (Optional) If you have more than one billing account and encounter the "You have multiple billing accounts" message, click GO TO LINKED BILLING ACCOUNT.
- In the side panel, navigate to Billing export, locate the Detailed usage cost section, and click EDIT SETTINGS.
- In this window, choose where to store the billing export (project and BigQuery dataset).
It may take up to 48 hours for new billing data to appear after configuring the export.
To ensure a smooth implementation, Attribute provides a Terraform module that automates the required setup and sensor registration. Detailed Terraform documentation and examples can be found in the [README] within the Terraform module.
GCP Account Types
The module supports installation on both a GCP organizational project and sub-projects. When running the module, specify whether you're deploying to the GCP Organization management project or to a sub-project where a sensor will be installed, using the account_type parameter.
Please note the following:
- Supported Terraform version is 1.9 and above.
- Whenever the sensor needs to be deployed, the module must be deployed on each sub-project. Additionally, if using an organizational billing project, the module must be deployed on both the billing project and its associated sub-projects to ensure full cost visibility.
- The module does not deploy the Attribute sensor on the compute infrastructure. That process is done with different tools per compute cluster (see Attribute's installation guide).
Resources Created by This Module
When running on a GCP organization management account, the following resources are created:
- Service account to allow secure access to the billing data.
- BigQuery Data Viewer permissions on the billing export dataset.
When running on a GCP sub-project, the following resources are created:
- Service account to allow secure access to the billing data.
The sensor registration process is fully automated within the module. For more information, refer to the module README.
Appendix A: Detailed Installation Instructions
This appendix walks you through the entire setup process, from the management account configuration to sensor deployment on a member account.
Step 1 — Billing Integration
1.1 Creating Billing Export Data
This is the same Billing Export configuration described above. If you've already configured the export, skip to step 1.2.
- Access the billing dashboard by selecting Billing in the console's navigation panel. If you have more than one billing account and see the "You have multiple billing accounts" message, click GO TO LINKED BILLING ACCOUNT.
- In the side panel, navigate to Billing export, locate the Detailed usage cost section, and click EDIT SETTINGS.
- Choose where to store the billing export (project and BigQuery dataset).
It may take up to 48 hours for new billing data to appear.
1.2 Running the Terraform for Billing Integration
The following steps should be done only on the management (payer) account.
-
Verify your Terraform version is 1.9 or above:
terraform version -
Update the following variables in the
main.tffile you received from Attribute:- Update the Terraform profile you're using so it points to the correct GCP account.
- Update the
projectandregioninformation. - Verify the alias is set to
"management". - Do not change the
organization_idandtoken— leave them as is. - Update the
billing_export_dataset_name. - Update the
billing_export_table_name.
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.0, <7.0"
}
}
}
provider "google" {
project = "my-main-1234"
region = "us-central1"
alias = "management"
}
# provider "google" {
# project = "my-sub-account-1234"
# region = "us-central1"
# alias = "sub1"
# }
module "attribute_management" {
source = "ZouzIO/attribute-sensor/gcp"
version = "~> 3.0"
token = "XXXXXXXXXXXXXXXXXX"
organization_id = "XXXXXXXXXXXXXXXXXXXXX"
account_type = "management"
billing_export_dataset_name = "your_billing_export_dataset_name"
billing_export_table_name = "your_billing_export_table_name"
providers = {
google = google.management
}
}
# module "attribute_sub1" {
# source = "ZouzIO/attribute-sensor/gcp"
# version = "~> 3.0"
#
# token = "XXXXXXXXXXXXXXXXXXXXX"
# organization_id = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# account_type = "sub"
# billing_info = module.attribute_management.billing_info
#
# providers = {
# google = google.sub1
# }
# } -
Apply the Terraform:
terraform init
terraform apply
Step 2 — Sensor Implementation
Configure each project (sub-account) where you plan to deploy a sensor. This involves two parts: running Terraform to create the prerequisites (once per sub-account), and then deploying the sensor on each GKE cluster using a Helm chart.
Step 2.1 — Terraform Prerequisite Setup (Member Account)
The following steps should be run once per project (sub-account).
-
Update the
main.tffile you received from Attribute to reflect the member account:- Update the Terraform profile to point to the correct GCP project.
- Uncomment the additional provider with the alias of the sub-account (you can have several sub-account providers as needed).
- Uncomment the sub-account module and update the project name from
"my-sub-account-1234"to your project name, plus the region info. - Do not change the
organization_idandtoken— leave them as is. - Make sure the billing information is preserved — do not delete the
billing_infodata.
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.0, < 8.0"
}
}
}
provider "google" {
project = "my-main-1234"
region = "us-central1"
alias = "management"
}
provider "google" {
project = "my-sub-account-1234"
region = "us-central1"
alias = "sub1"
}
module "attribute_management" {
source = "ZouzIO/attribute-sensor/gcp"
version = "~> 3.0"
token = "XXXXXXXXXXXXXXXXXXXXX"
organization_id = "XXXXXXXXXXXXXXXXXXXXXXXXXX"
account_type = "management"
billing_export_dataset_name = "your_billing_export_dataset_name"
billing_export_table_name = "your_billing_export_table_name"
providers = {
google = google.management
}
}
module "attribute_sub1" {
source = "ZouzIO/attribute-sensor/gcp"
version = "~> 3.0"
token = "XXXXXXXXXXXXXXXXXXXX"
organization_id = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
account_type = "sub"
billing_info = module.attribute_management.billing_info
providers = {
google = google.sub1
}
} -
Apply the Terraform:
terraform apply
Step 2.2 — Deploying the Sensor with Helm on GKE
The following steps should be repeated on every GKE cluster where you want to deploy the sensor.
-
Save the values file provided by Attribute (
values.yaml). This file contains a unique ephemeral token. -
Verify your Helm version — version 3.8.0 or above is supported:
helm version -
Install the Helm chart:
helm upgrade -i attribute \
oci://quay.io/attribute/operator-chart \
-f <values.yaml> \
-n attribute \
--create-namespace -
Verification. Run the following to verify the Helm release and that the operator and sensor are running:
helm list -n attribute
kubectl get pods -n attributeExample expected output:


If you'd like to deploy the sensor on other compute resource types (such as standalone), refer to the relevant sensor deployment documentation.
Trademarks: Google Cloud is a trademark of Google LLC. Terraform is a registered trademark of HashiCorp, Inc. Kubernetes is a registered trademark of The Linux Foundation. All other trademarks are the property of their respective owners.