Google Cloud Platform Configuration | Binadox - SaaS management

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.
Create a new project

2. Configure permissions on the project and on the Cloud Billing account.

3. Enable the BigQuery Data Transfer Service API
Big Query Data Transfet Service API enabled

4. Create a BigQuery dataset in which the data will be stored.
Crete BigQuery dataset

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.
Enable Cost and Pricing data transfer

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.
Open console

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

Run Binadox script

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)
  • Check created Roles
  • APIs (APIs & Services > Dashboard > scroll down)

enable required APIs

Troubleshooting:

  • 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
choose the required service account

Click on the Keys tab
click on keys tab

Create a new key
click to create a new key

Choose JSON > Create JSON file
choose to download 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

paste JSON file to Binadox