Installation
Add the provider to your Terraform configuration:Authentication
Get your API key from the Rivestack Dashboard. API keys use thersk_ prefix.
- Environment variable (recommended)
- Provider configuration
Node capacity
HA clusters run on prepaid node capacity, not per-cluster billing. You buy a pool of nodes once, then Terraform (or the API) provisions clusters that draw from it, so there’s no checkout in yourterraform apply loop.
1
Buy capacity in the dashboard
In the Rivestack Dashboard, go to Billing → Subscribe to Nodes, choose a server type (
starter, growth, or scale) and a quantity, then complete checkout. This is the only step that involves payment.2
Provision against the pool
terraform apply draws nodes from your pool automatically, matching on server_type. A growth cluster with node_count = 2 consumes two growth nodes from your growth pool. There is no extra charge per cluster.Provision with the REST API
If you don’t use Terraform, call the same endpoint directly. Create an API key, buy capacity, then:Omit
server_type to default to starter. The cluster is matched to a pool of the same server type and capacity is found automatically, with no pool ID needed.Quick start
This example creates a 2-node HA cluster with a database and user:Resources
rivestack_cluster
Manages an HA PostgreSQL cluster.
Read-only attributes:
id, host, connection_string, db_user, db_password, status, tenant_id, created_at, updated_at
rivestack_cluster_database
Creates a database on a cluster.rivestack_cluster_user
Creates a database user with an auto-generated password.
Read-only attributes:
id, password (sensitive)
rivestack_cluster_grant
Grants a user access to a database.Grant revocation is not currently supported by the API. Destroying this resource removes it from Terraform state only.
rivestack_cluster_extension
Installs a PostgreSQL extension on a database.Extensions cannot be removed from running clusters. Destroying this resource removes it from Terraform state only.
rivestack_cluster_backup_config
Configures automated backups for a cluster.Data sources
rivestack_cluster
Read information about an existing cluster.name, region, server_type, node_count, postgresql_version, host, connection_string, db_name, db_user, db_password, db_type, status, health_status, tenant_id, created_at, updated_at