Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 13 min read How-to mediumAdept

Using ClickHouse Cloud and Terraform for CI/CD

ClickHouse's new Terraform provider, built on the ClickHouse Cloud API, can provision ephemeral ClickHouse Cloud services for CI. The ClickHouse Go client's GitHub Actions tests were moved off a shared, always-on production service, which had been a single point of failure, caused table explosion and concurrent-DDL ZooKeeper load, and made logs hard to debug. Each test run now creates its own development-tier service with Terraform, runs the suite and destroys the service, usually in under 10 minutes. The walkthrough covers API token setup, provider configuration with secret tfvars, the HCL service resource with host and service-id outputs, and the changes to the workflow.

Related posts

  • Announcing support for ClickStack in the ClickHouse Terraform provider

    ClickHouse mediumAdept

    The ClickHouse/clickhouse Terraform provider now manages ClickStack dashboards, alerts, sources, saved searches, connections and webhooks for both self-hosted and Managed ClickStack, in beta from v3.25. The support was added as a separate service module inside the existing provider rather than as a new provider, so Cloud deployments reuse the same API credentials and self-hosted ones use an endpoint plus a personal API key. Supporting it meant tightening the ClickStack OpenAPI contract with named types, consistent integer fields and structured validation errors. Dashboard JSON is also validated against the ClickStack API during terraform plan, falling back to a warning on older versions. A walkthrough covers creating a dashboard with jsonencode, importing existing resources including generated import blocks and bulk export, and a caveat that UI edits are not detected as drift and can be overwritten.

  • New Terraform provider: Manage ClickHouse database users, roles, and privileges with code

    ClickHouse mediumAdept

    ClickHouse's new clickhousedbops Terraform provider, now generally available, manages databases, users, roles and privilege grants on both ClickHouse Cloud and self-hosted instances. A walkthrough provisions a Cloud service with the existing clickhouse provider, then wires clickhousedbops to the service's native-secure endpoint to create a database, three users, table-scoped SELECT roles and role grants in a single apply. For self-hosted clusters with multiple replicas, set cluster_name so resources are created on every replica. It must stay null on ClickHouse Cloud and should be omitted when user_directory uses replicated storage.

  • Terraform & OpenAPI for ClickPipes is now Generally Available

    ClickHouse mediumAdept

    ClickPipes, ClickHouse Cloud's managed ingestion service, is now generally available in the ClickHouse Terraform provider (v3.14.0+) and via stable OpenAPI endpoints. Coverage now includes CDC pipes for Postgres, MySQL and MongoDB, BigQuery and Azure Blob connectors, S3/GCS unordered mode and reverse private endpoints, with SSH tunneling still missing. A walkthrough shows how to configure a Postgres CDC pipe in HCL and import existing pipes using import blocks and -generate-config-out. A known limitation is that importing Postgres CDC pipes requires applying with stopped = true first so credentials are written to state.

  • Getting started with clickhousectl: the ClickHouse CLI for local and cloud

    ClickHouse mediumAdept

    clickhousectl (alias chctl) is a single CLI that manages local ClickHouse versions, isolated named servers, project scaffolding and ClickHouse Cloud services. Shared version binaries, per-directory named servers with auto-assigned ports, and a standard clickhouse/ layout for tables, materialized views, queries and seed data make side-by-side upgrade testing straightforward. Cloud auth is deliberately split: browser OAuth grants read-only access, while service creation, scaling and schema changes require an API key, a guard aimed at agent-driven use. The tool also installs Claude Code skills for local dev and cloud deploy, and fits into CI via a static binary, env-var auth and JSON output, with a sample GitHub Actions schema-validation workflow.

  • Cisco Talos empowers threat researchers while reducing TCO by 75% with ClickHouse Cloud

    ClickHouse mediumAdept

    Cisco Talos moved its file-hash reputation service, nearly 2 trillion rows (192 TB compressed, ~2 PB raw) growing by 27 billion rows a day, from a self-managed ClickHouse cluster on EKS to ClickHouse Cloud with zero downtime. The new pipeline replaces custom ingestion code with EventBridge, SQS and ClickPipes. It uses SharedMergeTree on object storage with query-time aggregation instead of pre-aggregation, and serves queries over AWS PrivateLink. The migration ran in four phases: Terraform foundation, a sharded backfill, shadow traffic, then cutover with a 100% match on 1,000+ sampled hashes. Separating storage from compute cut storage costs ~90%, total cost of ownership ~75%, and saved over 300 engineer hours a year.

The quest for software engineering knowledge.

Look:
Layout: