Skip to main content
Connect your GCP projects to enable CloudThinker agents to analyze costs, optimize resources, audit security, and manage infrastructure across Google Cloud services. GCP authenticates with a service-account key (a JSON file); the service account’s IAM roles determine what each agent can reach.

Prerequisites

  • A GCP project with IAM administrator access.
  • Permission to create service accounts and assign IAM roles in the project.
  • The Google Cloud Console accessible in your browser.
A viewer-level service account is sufficient for cost analysis, security audits, and resource inspection. Widen the roles only if you need write capabilities.

Setup

1

Create a service account

In the Google Cloud Console, select your project and navigate to IAM & Admin → Service accounts. Click Create Service Account and enter:
  • Name: cloudthinker-readonly
  • Description: Read-only access for CloudThinker monitoring
2

Assign roles

Grant the required viewer roles:
  • Viewer (basic read access)
  • Monitoring Viewer (for monitoring data)
  • Security Reviewer (for security analysis)
3

Generate a JSON key

Click on the created service account from the list, go to Keys tab → Add keyCreate new key, select JSON format, and click Create. Download the key file and store it securely.
4

Add the connection in CloudThinker

Navigate to Connections → GCP and upload the JSON key file (or paste its contents). Click Connect. CloudThinker verifies the credentials and shows a Connected status.
Store the JSON key file securely. Never commit it to version control or share it publicly.

Multi-project setup

For organizations with multiple GCP projects:
1

Grant organization-level access

Grant the service account roles at the organization or folder level so it can reach all target projects.
2

Add billing account access

Add Billing Account Viewer for cross-project cost analysis.
3

Add projects

CloudThinker automatically discovers accessible projects after connecting.

Connection details

The key file contains the following structure:

Required permissions

Minimum (read-only analysis)

Start with the minimum roles and add more only as needed. A viewer role at the project level is sufficient for cost analysis and most security audits.

Agent capabilities

Once connected, agents can analyze and optimize your GCP resources.

Verify the connection

Example prompts


Troubleshooting

Verify the service account has the required roles. Check project-level IAM bindings, ensure APIs are enabled (Compute, Monitoring, etc.), and confirm the JSON key is valid and not expired.
Verify the JSON file is complete and properly formatted. Check that the private key hasn’t been truncated and that no extra whitespace or characters were added. Try regenerating the key from GCP Console.
Verify Billing Account Viewer role is assigned. Enable the Cloud Billing API and check that billing export to BigQuery is configured.
Ensure Kubernetes Engine Viewer role is assigned. Verify the cluster is in an accessible project and check if the cluster uses Workload Identity.

Security

  • Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
  • Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
  • Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
  • Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
  • Project scope — limit the service account’s IAM roles to only the GCP projects CloudThinker needs to access.
  • Key storage — store the service-account JSON in a secret manager and delete local copies after uploading to CloudThinker.

AWS Connection

Connect Amazon Web Services

Kai Agent

Kubernetes-focused agent for GKE