See all blog posts

Automate ScyllaDB X Cloud Clusters with Terraform

The ScyllaDB Cloud Terraform provider gives you infrastructure-as-code control over your clusters

The ScyllaDB Cloud Terraform provider now supports ScyllaDB X Cloud. That means you can provision and manage elastic, autoscaling ScyllaDB clusters the same way you manage the rest of your infrastructure.

The ScyllaDB Cloud Terraform Provider

The provider lives at registry.terraform.io/scylladb/scylladbcloud. You need a ScyllaDB Cloud account and an API token from cloud.scylladb.com.

terraform {
  required_providers {
    scylladbcloud = {
      source  = "registry.terraform.io/scylladb/scylladbcloud"
      version = "~> 0.3"
    }
  }
  required_version = ">= 0.13"
}

provider "scylladbcloud" {
  token = var.scylladb_token
}

Pass the token through a variable.

What Is ScyllaDB X Cloud?

ScyllaDB X Cloud is ScyllaDB’s elastic cluster tier built on a tablets-based architecture. Traditional ScyllaDB clusters use token ranges pinned to nodes. Scaling them up or down means rebalancing large chunks of data. X Cloud uses tablets, which are smaller, independently moveable units of data. When you add or remove nodes, tablets rebalance in parallel across the cluster, which makes scaling fast and non-disruptive.

In practice this means you can:

  • Scale from 100K to 2M ops/sec in minutes, not hours
  • Push storage utilization up to 90% before scaling out (no wasted headroom)
  • Scale-in when load drops (pay for what you use)

X Cloud also differs from standard clusters in how you configure it in Terraform: instead of choosing a fixed node type and count, you define a scaling policy and let the platform decide the right size.

Provisioning an X Cloud Cluster

Here is a complete cluster resource:

resource "scylladbcloud_cluster" "xcloud" {
  name       = "my-xcloud-cluster"
  cloud      = "AWS"
  region     = "us-east-1"
  cidr_block = "172.31.0.0/16"

  scaling {
    instance_families = ["i8g"]

    storage_policy {
      min_gb             = 500
      target_utilization = 0.75
    }

    vcpu_policy {
      min = 6
    }
  }
}

The scaling block is what makes this an X Cloud cluster. It is mutually exclusive with the node_type and min_nodes fields used by standard clusters (you use one or the other).

Key Scaling Parameters

instance_families

instance_families = ["i8g"]

X Cloud scales within a single instance family. The platform picks specific instance sizes within that family as load changes. Sticking with instance_families rather than listing explicit instance_types gives the autoscaler more room to work with. If you do restrict it to specific types, allow at least three different types to give the scaler meaningful options.

storage_policy.min_gb

storage_policy {
  min_gb = 500
}

The cluster will not scale below this physical storage threshold. Set it when you know your dataset has a minimum size and want to avoid scale-in churn.

storage_policy.target_utilization

storage_policy {
  target_utilization = 0.75
}

This is the utilization level the autoscaler aims to maintain. The valid range is 0.7–0.9 (default: 0.8). The scaler adds capacity when utilization exceeds target by more than 5%, and removes capacity when it falls more than 5% below target. For write-heavy workloads, staying below 0.85 is a good baseline. It gives compaction and repairs room to breathe.

vcpu_policy.min

vcpu_policy {
  min = 6
}

The cluster will not scale below this vCPU count, regardless of load. That’s good for latency-sensitive workloads where you want compute headroom even at low traffic.

Standard Clusters (For Comparison)

If you need a fixed-size cluster or require multi-DC deployments (which will be supported soon), use the standard configuration:

resource "scylladbcloud_cluster" "standard" {
  name      = "my-standard-cluster"
  cloud     = "AWS"
  region    = "us-east-1"
  node_type = "i3.large"
  min_nodes = 3
  cidr_block = "172.31.0.0/16"
}

Standard clusters use node_type and min_nodes instead of a scaling block.

Outputs

After apply, the provider exposes:

output "cluster_id" {
  value = scylladbcloud_cluster.xcloud.cluster_id
}

output "datacenter" {
  value = scylladbcloud_cluster.xcloud.datacenter
}

output "node_dns_names" {
  value = scylladbcloud_cluster.xcloud.node_dns_names
}

node_dns_names provides the hostnames to pass to your driver configuration.

Wrapping Up

The ScyllaDB Cloud Terraform provider gives you infrastructure-as-code control over your clusters. For X Cloud specifically, the scaling block replaces the manual node sizing decisions. You just define the baselines and the platform handles the rest. ScyllaDB’s tablets-based architecture means scale events are fast enough to respond “just-in-time” to real traffic changes – so you don’t need to overprovision for peak capacity just in case.

For more details, see the full provider documentation at registry.terraform.io/providers/scylladb/scylladbcloud.

About Attila Tóth

Attila Tóth is a developer advocate at ScyllaDB. He writes tutorials and blog posts, speaks at events, creates demos and sample applications to help developers build high-performance applications.