Skip to content

Terraform Provider

Terraform Provider

Source on GitHub: terraform-provider-HDB-HeliosDB-Proxy

The Terraform provider wraps the Kubernetes operator: each resource calls controller-runtime/client to apply the corresponding CRD against the cluster. Five resources mirror the five CRDs one-for-one.

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/dimensigon/hdb-heliosdb-proxy:0.4.0"
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

ResourceWraps CRD
heliosproxy_instanceHeliosProxy
heliosproxy_pool_profilePoolProfile
heliosproxy_routing_ruleRoutingRule
heliosproxy_audit_policyAuditPolicy
heliosproxy_tenant_quotaTenantQuota