The official Terraform provider for Altinity.Cloud, enabling you to manage ClickHouse environments and infrastructure as code. This provider supports multiple cloud platforms including AWS, GCP, Azure, Hetzner Cloud, and Kubernetes clusters.
For detailed configuration options, see the Terraform Registry documentation.
If you're looking to set up the necessary infrastructure to connect your environments, see the connect modules:
- AWS: terraform-altinitycloud-connect-aws
- Kubernetes: terraform-altinitycloud-connect
Before using this provider, ensure you have:
- Terraform >= 1.0
- Altinity.Cloud account with Anywhere API access
- Cloud provider credentials (AWS, GCP, Azure, etc.) for the target environment
terraform {
required_providers {
altinitycloud = {
source = "altinity/altinitycloud"
version = "~> 0.4.0"
}
}
}
provider "altinitycloud" {
# API token can be set via ALTINITYCLOUD_API_TOKEN environment variable
api_token = "your-api-token-here"
}
For comprehensive examples covering all supported cloud platforms and use cases, see the examples directory:
- Resources: AWS, Azure, GCP, Hetzner Cloud, and Kubernetes environments with various configurations
- Data Sources: Environment status monitoring and validation examples
- Advanced Configurations: VPC peering, custom networking, secrets management, and more
Quick example for AWS:
resource "altinitycloud_env_certificate" "example" {
env_name = "my-clickhouse-env"
}
resource "altinitycloud_env_aws" "example" {
name = altinitycloud_env_certificate.example.env_name
aws_account_id = "123456789012"
region = "us-west-2"
zones = ["us-west-2a", "us-west-2b"]
cidr = "10.67.0.0/21"
node_groups = [
{
node_type = "m6i.large"
capacity_per_zone = 5
reservations = ["CLICKHOUSE"]
}
]
}
Resource | Description |
---|---|
altinitycloud_env_certificate |
Generate environment certificates for cloud connection |
altinitycloud_env_aws |
Manage AWS-based ClickHouse environments |
altinitycloud_env_azure |
Manage Azure-based ClickHouse environments |
altinitycloud_env_gcp |
Manage GCP-based ClickHouse environments |
altinitycloud_env_hcloud |
Manage Hetzner Cloud-based ClickHouse environments |
altinitycloud_env_k8s |
Manage Kubernetes-based ClickHouse environments |
altinitycloud_env_secret |
Manage environment secrets and configuration |
Data Source | Description |
---|---|
altinitycloud_env_aws_status |
Monitor AWS environment provisioning status |
altinitycloud_env_azure_status |
Monitor Azure environment provisioning status |
altinitycloud_env_gcp_status |
Monitor GCP environment provisioning status |
altinitycloud_env_hcloud_status |
Monitor Hetzner Cloud environment provisioning status |
altinitycloud_env_k8s_status |
Monitor Kubernetes environment provisioning status |
- Authentication errors: Ensure your API token is valid and has proper permissions. Check the
ALTINITYCLOUD_API_TOKEN
environment variable. - Environment provisioning fails: Use the corresponding status data source to wait for provisioning completion and get detailed error information.
- Resource dependencies: Always use status data sources to ensure proper resource ordering and error detection.
If you encounter issues not covered above, please create an issue with detailed information about your problem.
Contributions are welcome! Please submit a Pull Request or open an issue for major changes. See CONTRIBUTING.md for development guidelines and setup instructions.
All code, unless specified otherwise, is licensed under the Apache-2.0 license. Copyright (c) 2023 Altinity, Inc.