Prerequisites

<< Click to Display Table of Contents >>

Raynet One Data Hub > 14.0 > Connectors > Alphabetic Connector List > Google Cloud BigQuery 

Prerequisites

In order to use the connector, it is necessary to create a Service Account Key JSON as explained in the official documentation.

 

Download it to the local machine and extract the necessary data from the JSON file for the operation of the connector.

 

Authentication and Authorization

To use on Service Account Key in multiple projects, it has to be added in IAM of other projects. The connector requires the following scope for authentication: https://www.googleapis.com/auth/cloud-platform.

 

For authentication with the REST APIs a private key (json file) for each Google account has to be created in the Google portal and stored on the server. The required configuration is described in the following.

 

GCBQ_Environment

 

For each Google Cloud Account that needs to be connected with License Manangement, perform the following steps in the Google Cloud portal:

 

1.Select the project where the Service Account should be created (it will then be possible to give the appropriate permissions to the other projects with the same service account).

2.Create a service account. After creating the account, grant it the viewer role, then authorize a virtual instance to run as that service account.

 

GCBQ_ServiceAccountDetails

 

GCBQ_ServiceAccountPermissions

 

3.For a service account, download a private key and store the .json file that is to be used to run the connector.

 

GCBQ_Keys

 

GCBQ_JSON

 

4.Save the file locally.

5.Activate the appropriate / required APIs

 

In order to use one Service Account Key in multiple projects, it has to be added to the IAM to other projects.

 

1.Create a service account within the Service Accounts section.

 

GCBQ_ServiceAccounts

 

2.Add to the IAM section of the cross project.

 

GCBQ_Permissions

 

Generally, the organization, folder, and project structure should already be present whether a project is exempt or should be included in the inventory management.

 

These are than managed by policies. This is the best way of organizing access for the service account.

 

To export the billing data into BigQuery, the following points are to be considered:

 

BigQuery Export (turn on)

Project to host the BigQuery dataset

Billing Reports

Permissions

Kind of data (per resource, software, marektplace), PAYG vs. BYOL

 

When exporting and analyzing Cloud Billing data with BigQuery, the associated cost will depend on the amount of data that is being streamed, stored, and queried.

 

How to Enable Billing Export to BigQuery

1.Go to the Google Cloud Platform Console and select the internal project:

 

GCBQ_SelectProject

 

2.Open the main menu in the top left corner and select Billing.

 

GCBQ_Billing

 

3.If there are more than one billing accounts, choose the option Go to linked billing account to manage the billing of the project that has been selected. To select a different billing account, click Manage billing accounts.

4.Click on the target account for the export.

 

GCBQ_ManageBillingAccounts

 

5.Then click on Billing export.

 

GCBQ_BillingExport

 

6.Select BigQuery export.

7.Select the project where the BigQuery dataset is stored from the Project list. If there are no BigQuery datasets yet, there will be a prompt to create one.

8.Follow these steps to create a new dataset:
In the BigQuery web UI, on the left navigation bar, click on the down arrow next to the project name, then click on Create new dataset.

 

GCBQ_NewDataset

 

9.Specify the Dataset ID (no spaces allowed), Data location, and Data expiration, then click OK.

10.In the console, go back to Billing - Billing export and select the project from the Project dropdown (if not already selected). Click the Edit Settings button.

11.Then choose a dataset to export data to from the Billing export dataset list. If a new dataset has just been created, select its name and click on the Save button.

 

papercliper

Note:

This only needs to be done once per billing account. Not per project.

 

After BigQuery export has been enabled, the system may take a few hours to update the data and make it visible. Data is automatically exported to BigQuery on a regular basis, but the frequency of updates in BigQuery can vary depending on the services used.

 

GCBQ_LastStep

 

Set Up a Single and Multiple GCP Projects

Under the following link the required steps can be found:

https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/importing-and-viewing-gcp-billing-data