GCP workload identity authentication is in Private Preview. Contact ClickHouse Support to enable it for your organization.
Before you begin
You need:- Private Preview access enabled for your ClickHouse Cloud organization.
- A ClickHouse Cloud service running on GCP. Its ClickPipes deployment must also run on GCP.
- A ClickHouse Cloud API key with permission to manage ClickPipes on the service.
- Permission to grant IAM roles on the Google Cloud source resources.
- For Terraform, a ClickHouse provider release that includes the
clickhouse_clickpipes_service_contextdata source. Check the provider changelog before selecting a version.
How it works
- ClickPipes creates and manages a Google service account for your ClickHouse Cloud service.
- You retrieve that service account from the ClickPipes service context.
- You grant the service account access to your Google Cloud source resources.
- ClickPipes uses workload identity to obtain short-lived credentials for the service account and access the source.
Retrieve the ClickPipes service account
Use OpenAPI or Terraform to retrieve the service context. Do not create the ClickPipe until the context reports that workload identity is supported and ready.- OpenAPI
- Terraform
Set your API credentials and resource IDs:Get the service context:Once the identity is ready, the response includes the managed service account in If the ClickHouse service has not used ClickPipes before, the response can initially report
principal:ready: false without a principal. Retry until ready is true and principal is populated.See the service context API reference for the complete response schema.Grant access to the source
UseserviceAccount:<principal> as the IAM member, where <principal> is the email returned in the service context. Grant it only the roles required by your source, as described in the source’s permissions section:
ClickPipes cannot create IAM bindings in your Google Cloud project. Create the grants before creating the ClickPipe. When managing the grants and ClickPipe in the same Terraform configuration, use depends_on to enforce this ordering.
Create the ClickPipe
Set the source’s authentication method toSERVICE_ACCOUNT_WORKLOAD_IDENTITY. Do not configure a service account key, access key, connection string, or IAM role together with workload identity.
See the programmatic examples for each source:
- Google Managed Kafka with Terraform
- Google Cloud Storage with Terraform
- Google Cloud Pub/Sub with Terraform
- BigQuery with Terraform
- OpenAPI examples
Troubleshooting
Workload identity is not supported
Workload identity is not supported
Confirm that Private Preview access is enabled and that both the ClickHouse Cloud service and its ClickPipes deployment run on GCP. Contact ClickHouse Support if the service meets these requirements but
supported is false.The identity is not ready
The identity is not ready
Identity provisioning may still be in progress. Retry the service context request, or increase
ready_timeout when using Terraform. Do not create the ClickPipe until ready is true and principal is populated.The source rejects access
The source rejects access
Confirm that the IAM member is
serviceAccount:<principal> using the exact principal from the service context. Verify that roles are granted at the correct project, dataset, bucket, subscription, or cluster scope. For Google Managed Kafka, also check the broker-side Kafka ACLs and TLS configuration.