Skip to main content

Connect Google Cloud account

Before you begin

  • This page applies only if DoiT is NOT your cloud reseller.

  • You'll be charged 2% of the monthly spend on these accounts.

See Connect cloud account for more information.

Required permissions

You need to have the following roles:

Connect Google Cloud account

To connect your Google Cloud Billing account:

  1. Sign in to the DoiT console.

  2. Launch the connection wizard:

    • If you just start working with DoiT, select Google Cloud Platform as the cloud provider on the welcome page to open the wizard.

    • If you have already connected one or more cloud accounts with DoiT, navigate to the Home page, scroll down to the Connect your cloud section, and then choose Connect your Google Cloud account.

  3. Review the required roles on the Overview page. Make sure that your account has sufficient permissions before continuing.

  4. Select Next to continue.

Enable detailed usage cost

The Cloud Billing detailed usage cost data includes the standard usage cost data plus granular, resource-level cost data. Cloud Billing export to BigQuery enables you to export billing data to a BigQuery dataset that you specify.

To enable detailed usage cost data export:

  1. Open the Billing export page in the Google Cloud console.

  2. Select the Cloud Billing account that you want to connect to the DoiT console.

  3. On the BigQuery export tab, go to the Detailed usage cost and select Edit settings.

  4. From the Projects list, select a project to store the exported Cloud Billing data.

  5. In the Dataset field, choose to create a new dataset:

    • For Dataset ID, enter a unique dataset name.

    • Choose a Multi-region location. You can't change the location once the dataset is created.

    Tip

    The location type impacts the timing of backfill. For a dataset with a multi-region location, billing data is added retroactively for the current and previous month. See BigQuery dataset locations supported for use with Cloud Billing data for more information.

  6. Save your configurations. If successful, the Detailed usage cost will show Enabled.

  7. Select the checkbox I have enabled detailed usage report.

Provide billing data information

The DoiT console accesses your Cloud Billing data from the BigQuery dataset you specified when enabling detailed usage cost.

In the DoiT console, enter the following information:

  • Billing account: ID of the Google Cloud Billing account whose billing data you want to monitor and analyze. You can find Cloud Billing accounts on the Manage Billing Accounts page in the Google Cloud console.

  • Project ID: ID of the Cloud project that contains your BigQuery dataset. See Identifying projects.

  • Dataset name: Name of the BigQuery dataset that contains BigQuery tables with your exported detailed usage cost data. See Getting dataset information.

Grant BigQuery dataset permissions

In this step, you grant permissions to the DoiT service account so that it can access BigQuery resources.

Replace the placeholder values in the code snippets, then copy and run the commands in sequence in Google Cloud Shell:

  1. Add an IAM policy binding to your Billing account to grant the Billing Account Viewer role to your DoiT service account.

    gcloud billing accounts add-iam-policy-binding $BILLING_ACCOUNT_ID \
    --member=serviceAccount:$DOIT_SERVICE_ACCOUNT \
    --role=roles/billing.viewer
  2. Set the project property in the core section.

    gcloud config set project $PROJECT_ID
  3. Grant DoiT service account the BigQuery READER basic role (maps to bigquery.dataViewer) on the dataset that contains your billing data.

    bq show --format=prettyjson $DATASET_ID |
    jq '.access = .access + [{"role": "READER", "userByEmail": "$DOIT_SERVICE_ACCOUNT"}]' \
    >permissions.json

    Update the permissions using the JSON file.

    bq update --source permissions.json $DATASET_ID
  4. Select Activate to complete the process.

See also

Interactive demo

Try out our interactive demo for a hands-on walk-through experience.

If the demo doesn't display properly, try expanding your browser window or opening the demo in a new tab.

What's next

After you successfully connected your account, we start importing your billing data and notify you when the data is available for Cloud Analytics and other DoiT features.