Prerequisites
Before connecting, make sure you have:- A GCP project with the resources you want to monitor
- The
gcloudCLI installed and authenticated, or access to the GCP console - Permission to create service accounts and assign IAM roles in the project
Create the service account
Run the following commands to create a service account with the minimum required roles and download a JSON key:Required IAM roles
| Role | Purpose |
|---|---|
roles/viewer | Read access to Compute Engine, Cloud Storage, GKE, and other resource types |
roles/bigquery.dataViewer | Read access to billing export tables in BigQuery |
The
roles/viewer role grants broad read access across all GCP services in the project. If you prefer a narrower scope, you can replace it with a custom role that includes only the specific APIs InfraAudit needs for resource discovery.Set up billing export (optional)
To ingest cost data, you need to enable BigQuery billing export in GCP first. Without this step, InfraAudit discovers resources but shows no billing data for GCP.Choose or create a dataset
Choose an existing BigQuery dataset or create a new one (for example,
billing_export) to receive the export data.BigQuery billing export has a 1-to-2 day lag from GCP. Data for day D typically appears in BigQuery by the end of day D+2.
Connect your GCP project
- UI
- CLI
- API
Enter your credentials
- Paste the full contents of
infraudit-key.jsoninto the Service Account JSON field. - Enter the Project ID.
- (Optional) Enter the Billing BigQuery dataset name if you configured billing export.
What gets synced
| Resource type | Internal type name |
|---|---|
| Compute Engine instances | gcp_compute_instance |
| Cloud Storage buckets | gcp_storage_bucket |
| BigQuery datasets | gcp_bigquery_dataset |
| GKE clusters | gcp_gke_cluster |
Security notes
- The service account JSON key is encrypted at rest using AES-GCM.
- InfraAudit never writes to your GCP project. All API calls are read-only.
- After downloading
infraudit-key.json, delete the local file once you’ve entered the credentials in InfraAudit.