---
title: "Using ClickHouse Cloud and Terraform for CI/CD"
description: "ClickHouse's new Terraform provider, built on the ClickHouse Cloud API, can provision ephemeral ClickHouse Cloud services for CI."
url: "https://swe.quest/articles/using-clickhouse-cloud-and-terraform-for-ci-cd-825467f2e42309bb"
canonical: "https://clickhouse.com/blog/clickhouse-cloud-terraform-for-continuous-integration-and-continuous-delivery-deployment-ci-cd"
source: "ClickHouse"
published: "2023-07-13"
difficulty: "medium"
kind: "How-to"
reading_minutes: 13
tags: ["infrastructure-as-code","ci-cd","testing","cloud","cost-optimization"]
---

# Using ClickHouse Cloud and Terraform for CI/CD

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2023-07-13, 13 min read, How-to. Original: [https://clickhouse.com/blog/clickhouse-cloud-terraform-for-continuous-integration-and-continuous-delivery-deployment-ci-cd](https://clickhouse.com/blog/clickhouse-cloud-terraform-for-continuous-integration-and-continuous-delivery-deployment-ci-cd)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Infrastructure as code](https://swe.quest/tags/infrastructure-as-code.md) (Infrastructure)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)

## Prerequisites

- Terraform basics ([easy posts on Infrastructure as code](https://swe.quest/tags/infrastructure-as-code.md?difficulty=easy))
- GitHub Actions workflows ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))

## Keywords

ClickHouse Cloud, Terraform, GitHub Actions, HCL, clickhouse-go, Terraform provider

## Related posts

- [Announcing support for ClickStack in the ClickHouse Terraform provider](https://swe.quest/articles/announcing-support-for-clickstack-in-the-clickhouse-terraform-provider-6073258c01f3d44f.md): ClickHouse · 2026-08-14 · Medium · 9 min read · Infrastructure as code, Observability, API design
  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.
- [New Terraform provider: Manage ClickHouse database users, roles, and privileges with code](https://swe.quest/articles/new-terraform-provider-manage-clickhouse-database-users-roles-and-privileges-de303daee5cfd5b2.md): ClickHouse · 2025-06-20 · Medium · 6 min read · Infrastructure as code, Identity & auth, Databases
  ClickHouse's new clickhousedbops Terraform provider, now generally available, manages databases, users, roles and privilege grants on both ClickHouse Cloud and self-hosted instances.
- [Terraform & OpenAPI for ClickPipes is now Generally Available](https://swe.quest/articles/terraform-openapi-for-clickpipes-is-now-generally-available-fd4c0a6c8bc9212b.md): ClickHouse · 2026-04-20 · Medium · 7 min read · Infrastructure as code, Data pipelines, Analytics & OLAP, API design
  ClickPipes, ClickHouse Cloud's managed ingestion service, is now generally available in the ClickHouse Terraform provider (v3.14.0+) and via stable OpenAPI endpoints.
- [Getting started with clickhousectl: the ClickHouse CLI for local and cloud](https://swe.quest/articles/getting-started-with-clickhousectl-the-clickhouse-cli-for-local-and-cloud-e3c5c42045cc8994.md): ClickHouse · 2026-04-16 · Medium · 7 min read · Analytics & OLAP, Developer tools, CI/CD, Cloud platforms, AI agents
  clickhousectl (alias chctl) is a single CLI that manages local ClickHouse versions, isolated named servers, project scaffolding and ClickHouse Cloud services.
- [Cisco Talos empowers threat researchers while reducing TCO by 75% with ClickHouse Cloud](https://swe.quest/articles/cisco-talos-empowers-threat-researchers-while-reducing-tco-by-75-with-b07e23f1f37bf66e.md): ClickHouse · 2026-06-15 · Medium · 6 min read · Analytics & OLAP, Cloud platforms, Cost optimization, Data pipelines, Threat detection
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
