How the billing structure works in GCP
GCP can be confusing when it comes to billing. To make it a little more clear, you configure your billing export to send the billing data into a project. When you use multiple projects, all billing data will accumulate into one billing account (which exports again to a project → BigQuery).Steps to Connect
Gather required information
Before starting the connection process, make sure you have the following information ready:Required:
- GCP Project ID(s) - The project ID(s) you want Yasu to scan
- Format:
my-project-id(not the project number) - You can provide multiple project IDs if needed
- Example:
production-project,staging-project
- Format:
-
Billing Account ID - Required for accurate cost calculations
- Format:
01ABCD-2EFGH3-456IJK - Found in: GCP Console → Billing
- Example:
029B0D-80B502-B17C09
- Format:
-
BigQuery Billing Export Dataset - Required for detailed cost analysis
- Dataset name where billing export is stored
- Format:
billing_dataorbilling_export_dataset - This is the BigQuery dataset containing your daily cost data
Export billing data to BigQuery
GCP works with BigQuery to update its price logging every few times a day. To set this up, see the following documentation:Or navigate to the Google Cloud Console Billing page and click on Billing export. On this page, you can enable the exporting.
Export Cloud Billing data to BigQuery
Official Google Cloud documentation
Make sure billing export is enabled before proceeding to the next steps, as Yasu requires access to BigQuery billing data.
Grant Yasu service account access
Yasu needs the following read-only roles to gather cost, usage, and resource information. The principle of least privilege applies, so attach only what is required.Service Account Email:
[email protected]Grant Project-Level Permissions
- Go to GCP Console → IAM & Admin → IAM
- Select the project you want to scan
- Click ”+ GRANT ACCESS” (or ”+ ADD”)
- Under “New principals”, add:
- Under “Select a role”, add these roles:
- ✅ Viewer (
roles/viewer) - Basic read access to project resources - ✅ Compute Viewer (
roles/compute.viewer) - For VM scanning - ✅ Cloud SQL Viewer (
roles/cloudsql.viewer) - For database scanning - ✅ Kubernetes Engine Viewer (
roles/container.viewer) - For GKE scanning - ✅ Storage Object Viewer (
roles/storage.objectViewer) - For storage scanning - ✅ Monitoring Viewer (
roles/monitoring.viewer) - For utilization metrics - ✅ BigQuery Data Viewer (
roles/bigquery.dataViewer) - For BigQuery scanning - ✅ Recommender Viewer (
roles/recommender.viewer) - For GCP recommendations - ✅ Billing Account Viewer (
roles/billing.viewer) - For cost calculations - ✅ Get the project name (
resourcemanager.projects.get) - Permission to retrieve project information
- ✅ Viewer (
- Click “SAVE”
You can grant these permissions at the Organization level if you want Yasu to access multiple projects.
Grant BigQuery dataset permissions
If you have BigQuery billing export configured, you need to grant dataset-level permissions:
- Go to GCP Console → BigQuery
- Select the project that hosts your billing export dataset
- In the Explorer panel, find your billing dataset
- Click the three dots (⋮) next to the dataset name
- Click “Share dataset”
- Click ”+ ADD PRINCIPAL”
- Under “New principals”, add:
- Under “Select a role”, select:
- ✅ BigQuery Data Viewer (
roles/bigquery.dataViewer)
- ✅ BigQuery Data Viewer (
- Click “ADD”
Enable required APIs
You must enable the following Google Cloud APIs in each project you want Yasu to scan.
Core APIs (Required for All Scans)
Enable these APIs in every project:-
✅ Cloud Resource Manager API
- API Name:
cloudresourcemanager.googleapis.com - Provides project information and access control
- API Name:
-
✅ Cloud Billing API
- API Name:
cloudbilling.googleapis.com - Critical: Needed for cost calculations
- API Name:
-
✅ Cloud Monitoring API
- API Name:
monitoring.googleapis.com - Critical: Needed for utilization metrics
- API Name:
-
✅ BigQuery API
- API Name:
bigquery.googleapis.com - Required for accessing billing export data
- API Name:
Service-Specific APIs
Enable these APIs only if you use these services:-
✅ Compute Engine API (if you have VMs)
- API Name:
compute.googleapis.com - Required for: VM scanning, disk scanning, IP scanning
- API Name:
-
✅ Cloud SQL Admin API (if you have Cloud SQL databases)
- API Name:
sqladmin.googleapis.com - Note: This API is NOT enabled by default - you must enable it manually
- API Name:
-
✅ Kubernetes Engine API (if you have GKE clusters)
- API Name:
container.googleapis.com - Note: This API is NOT enabled by default - you must enable it manually
- API Name:
-
✅ BigQuery Reservation API (if you use BigQuery slot commitments)
- API Name:
bigqueryreservation.googleapis.com - Note: This API is NOT enabled by default - you must enable it manually
- API Name:
-
✅ Cloud Storage API (if you use Cloud Storage)
- API Name:
storage.googleapis.com - Usually enabled by default
- API Name:
-
✅ Recommender API (for GCP native recommendations)
- API Name:
recommender.googleapis.com
- API Name:
How to Enable APIs
Option 1: Using GCP Console (Easiest)- Go to APIs & Services → Library
- Search for the API name (e.g., “Compute Engine API”)
- Click on the API
- Click “Enable”
- Repeat for all APIs listed above
Verify project requirements
Your projects must meet these requirements before connecting:
- ✅ Projects must be active (not deleted or suspended)
- ✅ Billing must be enabled (for accurate cost calculations)
- ✅ Projects should have resources (empty projects will show 0 results)
Complete connection in Yasu Dashboard
- In Yasu, navigate to Settings → Cloud Accounts → Add GCP Account.
- Enter your information:
- Project ID (hosting BigQuery billing dataset)
- Billing Account ID
- BigQuery Dataset Name (billing export dataset)
- Select whether you will upload the JSON key file or use Workload Identity with an existing service account.
- JSON Key: You’ll be prompted to upload your service account’s JSON key.
- Workload Identity: Provide the service account email you created above and ensure Yasu’s environment is allowed to assume that identity.
- Click Connect Account and wait for verification.
- Service account has required permissions
- APIs are enabled
- BigQuery dataset is accessible
- Billing information is available
What We Will Scan
Once configured, Yasu will scan your GCP environment for:Cost Optimization Opportunities
- Idle VM Instances - VMs that are running but not being used
- Over-Sized VMs - VMs that can be downsized to save costs
- Unattached Disks - Disks not connected to any VM
- Unused IP Addresses - Static IPs not being used
- Unused Storage Buckets - Cloud Storage buckets with no activity
- Underutilized BigQuery Slots - BigQuery commitments not fully used
- GKE Cluster Optimization - Kubernetes clusters that can be optimized
- Idle Cloud SQL Databases - Database instances with no activity
GCP Native Recommendations
We also pull recommendations directly from Google’s Recommender API for additional insights.Verification Steps
After connecting, Yasu will perform the following checks:-
Service Account Access Validation
- Verifies Yasu’s service account has the expected roles
- Confirms access to your projects
- Verifies the correct JSON key or Workload Identity binding
-
API Availability Check
- Verifies all required APIs are enabled
- Tests API connectivity
-
Data Collection Vectorizing
- Begins collecting Billing data (Cost Explorer / BigQuery cost table)
- Starts monitoring Resource metrics
- Initializes additional analyses based on your enabled APIs
-
Parsing Collected Data
- The collected data will be converted into Yasu’s internal format and stored in the vector database for cost optimization and recommendation generation
-
Integration Status
- You will see a green checkmark when the connection is successful
- Optimization recommendations will begin appearing after the initial sync (usually within a few minutes)
Common Issues and Quick Fixes
Issue: "API not enabled" Error
Issue: "API not enabled" Error
What it means: An API we need is not enabled in your project.Fix:
- Go to APIs & Services → Library
- Search for the API mentioned in the error
- Click “Enable”
- Wait 1-2 minutes
- Try connecting again in Yasu
Issue: "Permission denied" Error
Issue: "Permission denied" Error
What it means: Yasu’s service account doesn’t have the required permissions.Fix:
- Go to IAM & Admin → IAM
- Find
[email protected] - Make sure it has all the roles listed in Step 3 above
- If missing, add the required role
- Try connecting again
Issue: "BigQuery dataset not accessible"
Issue: "BigQuery dataset not accessible"
What it means: Yasu’s service account can’t access your BigQuery billing dataset.Fix:
- Go to BigQuery → Select your billing dataset
- Click three dots (⋮) → “Share dataset”
- Add
[email protected] - Grant BigQuery Data Viewer role
- Click “ADD”
- Try connecting again
Issue: "No resources found"
Issue: "No resources found"
What it means: Either:
- Your project has no resources (this is normal), OR
- Resources are in a different project
- Verify you provided the correct project ID
- Check if resources exist in the project
- If resources exist but aren’t found, contact support