Google Cloud Platform Configuration
This guide provides information on how to integrate a GCP account with the Binadox multi-cloud cost management and optimization platform to plan, analyze and reduce infrastructure costs.
1. Set up Cloud Billing data export to BigQuery
Cloud Billing export to BigQuery allows exporting comprehensive Google Cloud billing data (such as usage, cost, and pricing) automatically throughout the day to a specified BigQuery dataset.
To export Cloud Billing data to BigQuery, you need to follow the steps below:
1. Create a project where the Cloud Billing data will be stored, then enable billing on the project.
2. Configure permissions on the project and on the Cloud Billing account.
3. Enable the BigQuery Data Transfer Service API
4. Create a BigQuery dataset in which the data will be stored.
Before you enable your Cloud Billing data to export to BigQuery, you must create at least one BigQuery dataset to manage your exported data.
Enable Cloud Billing export of cost data and pricing data to be written into the dataset.
Follow the link below to find the full instruction on setting up an export to BigQuery given by Google Cloud Platform itself: https://cloud.google.com/billing/docs/how-to/export-data-bigquery-setup
2. Run the Script from the Cloud Shell (within cloud console)
Binadox script creates a Role with Permissions and enables APIs required for getting access to the Billing information.
To have the script running you need to follow the steps below:
1. Click on the “Activate Cloud Shell” icon. Once you do so, the cloud console opens.
2. Copy and paste the script into the opened cloud console – curl -o- https://gist.githubusercontent.com/binadox-public/7fcc24a9ad25f4564cdb23fb7ec39087/raw/a12600c02399daa188269e9a16763803e1b17972/setup-binadox-billing.sh
In case the script is successful, proceed to the next step. In case it brings you errors please read our Troubleshooting chapter below.
Check if all required roles, permissions, and APIs were created and enabled:
- Roles (IAM&Admin > Roles)
- APIs (APIs & Services > Dashboard > scroll down)
- Error text:
FAILED_PRECONDITION: You can’t create a role with role_id [name] where there is an existing role with that role_id in a deleted state.
Solution: Undelete the existing role with role_id [name], from your billing project, and run the script again.
- Error text:
Resource in a project is the subject of a conflict.
Solution: No additional actions required.
3. Create a JSON file for the required service account
Open APIs&Services > Credentials > Choose required service account
Click on the Keys tab
Create a new key
Choose JSON > Create JSON file
4. Integrate your GCP with Binadox using the downloaded JSON file
Open Binadox Cloud Cost Analysis > Choose to connect GCP account > Drag and Drop downloaded JSON file