<< Click to Display Table of Contents >> Raynet One Data Hub > 14.0 u1 > 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.
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.
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.
3.For a service account, download a private key and store the .json file that is to be used to run the connector.
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.
2.Add to the IAM section of the cross project.
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.
1.Go to the Google Cloud Platform Console and select the internal project:
2.Open the main menu in the top left corner and select 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.
5.Then click on Billing export.
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.
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.
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. |
Under the following link the required steps can be found:
https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/importing-and-viewing-gcp-billing-data