clickhouse_clickpipe resource in the ClickHouse Terraform provider. This page covers provider setup and configuration examples for each supported ClickPipe type.
Provider setup
ClickPipes support is generally available from provider version v3.14.0.
If you are using an earlier version, you will need an alpha release — check the
provider changelog
for details.
Resource overview
Theclickhouse_clickpipe resource has the following top-level arguments:
The
id and state attributes are read-only and populated by ClickHouse Cloud after creation.
GCP workload identity (Private Preview)
Follow the GCP workload identity guide to retrieve the ClickPipes-managed service account and grant it access to your source before using the workload identity examples below.Destination
Thedestination block is shared across all source types:
database is typically needed.
Examples by ClickPipe type
Kafka
Supportedtype values: kafka, confluent, msk, azureeventhub, redpanda, warpstream, and Private Preview gcmk.
Google Managed Kafka with GCP workload identity
Grant the ClickPipes service accountroles/managedkafka.client before creating the ClickPipe. Google Managed Kafka requires TLS. Kafka ACLs must allow the service account (User:<service-account-email>) READ and DESCRIBE access to the selected topics and consumer groups.
Kafka with schema registry
Amazon Kinesis
Kinesis with an uploaded Protobuf schema
Setformat to Protobuf and use protobuf_schema for a base64-encoded .proto file or serialized FileDescriptorSet. Do not configure schema_registry when uploading a schema.
Kinesis with IAM role
IAM role authentication requires a ClickHouse service running on AWS.Amazon S3
S3 continuous ingestion with SQS
For continuous ingestion using an SQS queue (unordered mode). See Configuring unordered mode for setup instructions.Google Cloud Storage
service_account_key must be the base64-encoded content of a GCP service account JSON key file.
GCS with GCP workload identity
After granting the ClickPipes service account the required GCS permissions, replace thesource block above with:
is_continuous = true and use a fully-qualified queue_url in the form projects/<project-id>/subscriptions/<subscription-id>.
Google Cloud Pub/Sub
The following example uses workload identity. Grant the ClickPipes service account the required Pub/Sub permissions before creating the ClickPipe.Azure Blob Storage
Postgres CDC
Postgres with IAM role
IAM role authentication requires a ClickHouse service running on AWS.MySQL CDC
MongoDB CDC
BigQuery
service_account_file must be the base64-encoded content of a GCP service account JSON key file.
BigQuery with GCP workload identity
After granting the ClickPipes service account the required BigQuery and GCS permissions, replace thesource block above with:
Scaling
All ClickPipe types support thescaling block to configure the number of replicas and their resource allocation: