Manage Vitess keyspaces, VTGates, and safe migrations in Terraform
You can now create, resize, and import Vitess keyspaces with planetscale_vitess_keyspace. Apply will wait until provisioning or resizing finishes. Updating cluster_size or extra_replicas resizes in place. Use this resource for additional keyspaces, or import the default keyspace to manage its size and replicas.
planetscale_vitess_branch now also supports safe migrations and VTGate configuration. Set size, count, autoscaling, and related options in Terraform, and apply will wait for VTGate resizes to finish.
resource "planetscale_vitess_branch" "main" {
organization = "my-organization"
database = "my-database"
name = "main"
safe_migrations = true
vtgate_size = "VTG_320"
vtgate_count = 2
vtgate_autoscaling = true
vtgate_max_count = 8
vtgate_target_cpu_utilization = 50
}