---
title: "Terraform Provider"
---

# Terraform Provider

:::note[Not publicly released]
The Terraform provider is a companion project to HeliosProxy that is **not
publicly released** — it is not on the Terraform Registry and has no public
repository. It is available on request: contact
[sales@heliosdb.com](mailto:sales@heliosdb.com).

The resource schema design is published in the public repository at
[`terraform/README.md`](https://github.com/HeliosDatabase/HeliosDB-Proxy/blob/main/terraform/README.md).
:::

The Terraform provider wraps the [Kubernetes operator](/docs/proxy/operator/) (also not publicly released): each resource calls `controller-runtime/client` to apply the corresponding CRD against the cluster. Five resources mirror the five CRDs one-for-one.

```hcl
provider "heliosproxy" {
  namespace = "data"
}

resource "heliosproxy_pool_profile" "default" {
  name          = "default-pool"
  mode          = "transaction"
  max_pool_size = 200
}

resource "heliosproxy_instance" "analytics" {
  name             = "analytics"
  replicas         = 2
  image            = "ghcr.io/heliosdatabase/hdb-heliosdb-proxy:latest" # pin a release tag in production
  pool_profile_ref = heliosproxy_pool_profile.default.name
  nodes = [
    { host = "pg-primary.db.svc", port = 5432, role = "primary", weight = 100 },
    { host = "pg-standby.db.svc", port = 5432, role = "standby", weight = 100 },
  ]
}
```

## Schema-import pattern

The schema doesn't drift from the operator because it imports the operator's Go types directly via a local `replace` directive. Adding a field to the operator's CRD makes it available in the provider on the next `make tidy && go build`.

## Resources

| Resource | Wraps CRD |
|---|---|
| `heliosproxy_instance` | `HeliosProxy` |
| `heliosproxy_pool_profile` | `PoolProfile` |
| `heliosproxy_routing_rule` | `RoutingRule` |
| `heliosproxy_audit_policy` | `AuditPolicy` |
| `heliosproxy_tenant_quota` | `TenantQuota` |
