Enable Billing Export
Please follow the official GCP guide to enable billing data export – Set up Cloud Billing data export to BigQuery | Google Cloud.
As the result, you should have a new table in your BigQuery project. Note the names of the dataset and the table. You will need them later when connecting your cloud account to SpendEffix.
gcp_billing_tables
Prepare a Role for SpendEffix
With a CLI command
Run the following command in GCP CLI:
gcloud iam roles create optscale_connection_role \
--project=cloudlyticscom \
--permissions=bigquery.jobs.create,bigquery.tables.getData,compute.addresses.list,compute.disks.list,compute.disks.setLabels,compute.firewalls.list,compute.instances.list,compute.instances.setLabels,compute.machineTypes.get,compute.machineTypes.list,compute.networks.list,compute.regions.list,compute.snapshots.list,compute.snapshots.setLabels,compute.zones.list,monitoring.timeSeries.list,storage.buckets.get,storage.buckets.list,storage.buckets.update
Via Google Cloud Console
- Go to Roles page and click Create Role.
- Give the role any name and description.
- Add the following permissions:
- bigquery.jobs.create
- bigquery.tables.getData
- compute.addresses.list
- compute.disks.list
- compute.disks.setLabels
- compute.firewalls.list
- compute.instances.list
- compute.instances.setLabels
- compute.machineTypes.get
- compute.machineTypes.list
- compute.networks.list
- compute.regions.list
- compute.snapshots.list
- compute.snapshots.setLabels
- compute.zones.list
- monitoring.timeSeries.list
- storage.buckets.get
- storage.buckets.list
- storage.buckets.update
Create Service Account
Official documentation on service accounts – Service accounts | IAM Documentation | Google Cloud.
- Go to Service accounts page and click Create Service Account.
- Give it any name and click Create and Continue.
- Specify the role that you created earlier and click Continue and then Done.
Generate API Key for Your Service Account
- Find your service account in the service accounts list and click on its name to go to the service account details page.
- Go to the Keys tab.
- Click Add key -> Create new key.
- Service account API key will be downloaded as a
.json
file. You will need this file on the next stage when connecting your cloud account to SpendEffix.
Connect Data Source in SpendEffix
Use the newly downloaded service account credentials .json
file with the billing dataset details to connect your GCP cloud account.