This repository contains Terraform scripts for automating the infrastructure deployment for ClickHouse on the Google Cloud Platform (GCP).
- Automates the creation of a Virtual Machine (VM) on the Google Compute Engine (GCE).
- Sets up an additional persistent SSD for data storage.
- Configures the network settings to allow traffic through the ClickHouse port.
- Assigns a static IP to the VM for consistent access.
- Terraform Installed
- GCP Account
-
Clone the repository to your local system.
git clone [email protected]:NikiforovG/clickhouse-terraform-gcp.git
-
Move to the directory containing the Terraform scripts.
cd clickhouse-terraform-gcp
-
Initialize your Terraform workspace, which will download the provider.
terraform init
-
Now, validate your configuration. If it's valid, the command won't return any errors.
From this moment make sure you have
GOOGLE_CREDENTIALS
environment variable defined with your service account json key.terraform validate
-
Now, let's plan our deployment.
terraform plan
-
Once everything is ready, apply your configuration.
terraform apply