Google Cloud
Connect
Infrastructure Manager deployment, or the Polylane Terraform module.
Connect one Google Cloud project with Infrastructure Manager or with the Polylane Terraform module. Setup uses temporary Google access. Ongoing reads use a separate reader identity with short-lived credentials and no service account key.
- Open Settings → Clouds → Connect → Google Cloud, then choose Continue with Google.
- Authorize a Google project administrator account, select one project and review the installation. Billing must be enabled on the project.
- Leave Investigate alerts on to have Polylane investigate your Cloud Monitoring alerts.
- Choose Connect project. Polylane turns on the APIs, prepares the installer and sends the deployment to Infrastructure Manager.
- Setup continues in the background. You can close the panel or the browser. Temporary Google access expires within one hour. If setup needs it, choose Authorize again to resume.
- After the deployment, Polylane checks the access and registers the project. Then the first inventory sync starts. Registration can finish before resources appear.
Your Google account needs permission to provision resources and to use the installer service account. Workspace members need cloud-account write permission to start a connection, and delete permission to cancel or disconnect one.
The deployment creates these items in the project:
- An installer service account whose name ends in
-im. It keeps its provisioning roles so that you can update or delete the deployment later. - A reader service account and a workload identity pool, so that Polylane gets short-lived reader tokens without a key.
- A Cloud Asset Inventory feed and a log sink, each with a Pub/Sub topic and a push subscription to Polylane.
- When Investigate alerts is on, a custom role for alert maintenance and a push service account for alerts.
Saved setup: A pending request lasts seven days. If this browser has no saved setup, reopen Google Cloud in the same workspace and sign in as the person who started it. Choose Resume setup for the matching project and deployment. If this browser restores a script-based request, run its prefilled script in Cloud Shell or a terminal signed in with gcloud, then choose Verify and connect.
Connect Google Cloud and manage its integration resources with Terraform.
The Polylane GCP module combines the Google provider with the Polylane provider. Configure Google credentials for your project and a Polylane API key with cloud-account read, write and delete scopes. Keep the credentials in environment variables or in your Terraform secret store.
module "polylane_gcp" {
source = "git::https://github.com/coreplanelabs/terraform-provider-polylane.git//modules/gcp?ref=v0.6.0"
workspace_id = "<workspace-id>"
project_id = "<google-project-id>"
installer_member = "user:<google-admin-email>"
}
The module creates the connection request, the Google resources and the grants, then verifies the connection.
How it works
Access
The reader identity gets Google tokens that expire after 15 minutes. It reads Cloud Asset Inventory, Logging, Monitoring, Cloud Trace, IAM policies, and the configuration of services such as Compute Engine, Cloud Run, Cloud Functions, Cloud SQL, Spanner, AlloyDB, BigQuery, Memorystore, Cloud DNS, Artifact Registry, Cloud Build, Cloud Deploy and GKE. It cannot read secret payloads, BigQuery table rows, Storage objects or artifact contents. It does not get the installer permissions.
Infrastructure graph
Polylane syncs the project every 15 minutes. It maps Compute Engine, networks and load balancers, Cloud Run, Cloud Functions, GKE clusters and node pools, Pub/Sub, Cloud Scheduler, Cloud Tasks, Workflows, Storage, Cloud SQL, Memorystore, Firestore, BigQuery datasets, Spanner, AlloyDB, Bigtable, Dataflow, Dataproc, IAM, KMS, Secret Manager, Artifact Registry, Cloud Build, Cloud Deploy and Vertex AI. For each GKE cluster, it also maps namespaces, nodes, workloads, pods, services and ingresses.
Between syncs, the asset feed sends resource changes to Polylane. The log sink sends Pub/Sub and Storage admin activity, which starts a direct read of the changed resource.
Metrics, logs and traces
Polylane reads Cloud Monitoring metrics for about 34 resource types and checks production resources for anomalies. Resource pages show logs for Cloud Run, Cloud Functions, Compute Engine, Cloud SQL, Memorystore, Pub/Sub, Storage, Cloud Tasks and GKE workloads. During an investigation, agents query Cloud Logging, Cloud Monitoring and Cloud Trace, and call read-only Google APIs in the connected project.
Alerts
When Investigate alerts is on, Polylane adds its own Pub/Sub notification channel to each of your Cloud Monitoring alert policies. It checks for new policies on each sync. It changes only the channel list. Your conditions, severity, other channels and enabled state stay the same. Polylane creates no alert policies.
Each alert becomes an issue, and a new issue starts an investigation. Repeat notifications for the same Google Monitoring incident go to the same issue. When the incident closes, Polylane adds the recovery to the issue. Each sync also reads open Google alerts, to find closures that Google did not deliver.
GKE and agent writes
Agents read GKE objects, live pod logs and resource usage through the cluster API. To let agents scale, restart or patch GKE workloads, set gke_operations_enabled in the setup module, then turn off Read-only for the account. Each write needs a safety review and your approval before it runs. Background runs stay read-only.
Alert delivery
Notifications carry the Google incident ID, policy and condition, state, timestamps, severity and resource labels.
- Log-based policies send only opening notifications. Polylane reads Google alert state on each sync to find their closures.
- PromQL incidents close after the larger of 270 seconds and twice the evaluation interval. PromQL notifications can omit the condition. Polylane then reads the incident policy snapshot to keep the policy ID.
- A policy can hold at most 16 notification channels. Polylane cannot add its channel to a full policy.
- Polylane cannot investigate an alert that fires before its channel is on the policy. A new policy gets the channel on the next sync.
- A notification larger than 32,000 bytes goes to quarantine and does not start an investigation.
- Google delivery, notification rate limits, snoozes and Pub/Sub retention still apply.
Google's policy update API replaces the full channel list and has no conditional update. Polylane reads each policy just before it changes the channel list. Tell your administrators to coordinate edits to the channel list of a policy.
Errors with alert setup show on the project settings page. Fix the access or the channel limit, then turn the setting on again or sync the account. For an existing connection without alert access, choose Prepare alert access setup, run the permissions-only script as a project administrator, then turn on the setting.
Turning the setting off removes the channel of this connection from your policies, and deletes its alert topic and push subscription.
Alert permissions
Alert maintenance uses a custom project role with these permissions:
- Policy maintenance:
monitoring.alertPolicies.get,monitoring.alertPolicies.list,monitoring.alertPolicies.update. - Incident closure reads:
monitoring.alerts.get. - Owned channel lifecycle:
monitoring.notificationChannels.get,monitoring.notificationChannels.list,monitoring.notificationChannels.create,monitoring.notificationChannels.delete. - Delivery topic lifecycle and publisher grant:
pubsub.topics.create,pubsub.topics.get,pubsub.topics.delete,pubsub.topics.getIamPolicy,pubsub.topics.setIamPolicy,pubsub.topics.attachSubscription. - Push subscription lifecycle:
pubsub.subscriptions.create,pubsub.subscriptions.get,pubsub.subscriptions.delete.
IAM cannot limit the policy update permission to the channel list. The Polylane maintenance client applies that limit. The reader also gets roles/iam.serviceAccountUser on the push service account of this connection only. Monitoring's service-PROJECT_NUMBER@gcp-sa-monitoring-notification.iam.gserviceaccount.com gets roles/pubsub.publisher on the alert topic. The reader gets no project IAM administration, role administration or Monitoring Editor role.
The permissions-only script needs iam.roles.get, iam.roles.create or iam.roles.update, resourcemanager.projects.getIamPolicy, resourcemanager.projects.setIamPolicy, iam.serviceAccounts.getIamPolicy and iam.serviceAccounts.setIamPolicy.
See Google's Monitoring permissions, Pub/Sub notification setup and push authentication.
Inventory freshness
Cloud Asset Inventory is eventually consistent and can miss updates. Google syncs some resource types hours apart, so the 15-minute sync does not guarantee 15-minute freshness at the source.
Deletions come from asset deletion events. When a resource is missing from a current snapshot, Polylane checks Google's resource history within its 35-day retention to confirm the deletion. When the history is unknown, expired or unclear, Polylane keeps the resource until it gets more evidence. For Pub/Sub topics and Storage buckets, a not-found answer from the Google API also confirms a deletion. Log investigations always query Google directly. See Google's consistency and freshness guidance.
Troubleshooting
Deployment needs attention: After Google reports a failed deployment, choose Review and retry deployment. Review the project, the existing deployment name and the published blueprint release, then choose Retry deployment. The retry uses the same connection request and Google deployment. Authorize Google again if setup access expired.
Verification needs attention: Make sure that Infrastructure Manager completed the deployment in the correct project. Check the enabled APIs and the granted permissions, then open the saved setup and choose Resume setup. For a restored script request, confirm the project number and choose Verify and connect. A temporary verification error needs no new request.
Update the project setup: Open the project settings in Polylane. The Project setup row shows the version of the service accounts and permissions that Polylane added to the project. Choose Update, authorize a Google Cloud administrator account, review the current and new versions, then choose Update deployment. The update changes the existing deployment, and the project stays connected. An update adds grants that an older setup lacks, such as configuration reads, Cloud Trace reads and GKE object reads.
Trace access: Turn on the Cloud Trace API. The application must send traces to Cloud Trace.
GKE access: Turn on external access through the cluster DNS endpoint. A public IP endpoint also needs network access and the cluster CA. If your endpoint or VPC Service Controls block remote access, connect the Kubernetes agent. Resource usage needs a working metrics API in the cluster.
Disconnecting
Disconnect the project in Polylane to stop credential issuance, processing and schedules. Polylane deletes the alert channel, topic and push subscription of the connection, and removes the project from the infrastructure graph. Google access tokens that Polylane already has expire within 15 minutes. Cancelling a pending request does not delete Google resources.
The other Google resources stay in your project. To remove them, delete the Infrastructure Manager deployment with resource deletion on, or run terraform destroy for the module. This removes the reader and push identities, the workload identity pool and provider, the IAM grants, the topics, the subscriptions, the asset feed and the log sink. Then remove the -im installer service account and its grants. Enabled APIs, Google-managed service agents, and the Infrastructure Manager state and staging buckets stay. Review them separately.
Disconnect
Disconnecting stops every sync and check and deletes the credentials Polylane held. Polylane removes what Google Cloud's API lets it remove. The following stays until you remove it yourself:
- Customer-managed Infrastructure Manager deployment or Terraform module: IAM, federation, Pub/Sub, asset feed and log sink
polylane cloud disconnect <id>Tools
8Operations agents can perform in threads.
Supported resources
74Resource types that show up in your infrastructure graph.