Terraform Provider v1.2.0
VeloDB Terraform Provider v1.2.0 adds Terraform support for virtual clusters. You can manage an active and standby cluster pair, track its health, and keep Terraform aligned with role changes after failover.
Highlights
Manage virtual clusters with Terraform
The new velodb_virtual_cluster resource lets you create, update, delete, and import virtual clusters. You can rename a virtual cluster, replace either physical cluster, and request an active-standby role change through Terraform.
This brings virtual cluster lifecycle management into your Terraform configuration, so you can review and maintain the pair alongside the rest of your infrastructure.
Keep Terraform aligned after failover
The provider reads the active and standby roles from VeloDB Cloud. If an external failover changes the live roles, a Terraform refresh reflects that state instead of automatically switching the pair back. This helps prevent routine Terraform operations from undoing a failover.
To request a role change, update the desired cluster IDs. To explicitly reapply the configured pair after an external role change, update pair_reconcile_trigger.
Review virtual cluster health
The resource exposes status, at_risk, risk_reasons, and risk_messages. Use these attributes in Terraform outputs or automation to see whether the pair is at risk and why.
How to use it
Create a virtual cluster from two running physical clusters in the same warehouse and in different availability zones. This example uses the warehouse's initial cluster as active and a separately managed cluster as standby:
resource "velodb_virtual_cluster" "production" {
warehouse_id = velodb_warehouse.main.id
name = "production_vc"
desired_active_cluster_id = velodb_warehouse.main.initial_cluster_id
desired_standby_cluster_id = velodb_cluster.standby.id
}
Replace these references with IDs from your configuration. For AWS BYOC, use physical cluster IDs returned by the BYOC module or by separately managed velodb_cluster resources. If the initial cluster ID is unavailable, use another managed cluster ID or a verified physical cluster ID.
After applying the configuration, configure your SQL client to use production_vc as its cluster, or set it as the default cluster for the relevant SQL user. Requests through the virtual cluster are routed to its current active member.
To manage an existing virtual cluster, import it into Terraform state using the warehouse ID and virtual cluster ID. To monitor health, expose the resource's status, at_risk, risk_reasons, and risk_messages attributes in Terraform outputs.
For more information, see the VeloDB Terraform provider documentation.