Skip to main content
To connect Google Cloud Platform as a data source for infrastructure inventory, observability, cost analysis, and optimization insights, you need to create a service account with a custom role.

Prerequisites

  1. Google Cloud CLI (gcloud) installed and configured
  2. A GCP project with appropriate admin access to create roles and service accounts
  3. Billing account access (for cost-related permissions)

Step 1: Get Your Project ID

Run the following command to get your GCP project ID:
Or list all projects:

Step 2: Create a Custom Role

Save the following role definition to a file called custom-role.yaml:
Create the custom role using gcloud CLI:

Step 3: Create a Service Account

Create a new service account for the Doctor Droid integration:

Step 4: Assign the Custom Role to the Service Account

Bind the custom role to the service account:

Step 5: Create and Download Service Account Key

Generate a JSON key file for the service account:
This will create a drdroid-key.json file containing the service account credentials. Important: Store this key securely. It provides access to your GCP resources.

Step 6: Configure in Doctor Droid Platform

  1. Navigate to the Integrations tab in the Doctor Droid platform
  2. Click Add New Integration
  3. Select Google Cloud and click Connect
  4. Fill in the following credentials:
  1. Click Test Connection to verify the setup
  2. Click Save to complete the integration

Permissions Overview

The custom role provides read-only access to:

Organization-Level Access (Optional)

To grant access across multiple projects in an organization, create the role at the organization level:

Troubleshooting

Role Creation Failed

Ensure you have roles/iam.roleAdmin or roles/owner permission on the project. You may need to enable the IAM API:

Service Account Creation Failed

Verify that:
  • The IAM API is enabled
  • You have iam.serviceAccounts.create permission
  • The service account name is unique

Permission Denied Errors

Some permissions require specific APIs to be enabled:

Integration Test Failed

Check that:
  • The Project ID is correct
  • The JSON key file contents are complete and properly formatted
  • The service account has the custom role assigned
  • Required APIs are enabled in the project

Billing Permissions Not Working

Billing permissions require the service account to be added to the billing account:
  1. Go to Billing Console
  2. Select your billing account
  3. Click Account Management
  4. Add the service account email with Billing Account Viewer role