Provisions a managed Postgres instance using each cloud's native service -- RDS on AWS, Cloud SQL on GCP, Flexible Server on Azure. The blueprint picks the right Terraform module based on your environment's cloud provider, so your other installations reference the same outputs regardless of where they run.
Instances get encryption at rest (with your own KMS or Key Vault key if you supply one) and automated backups. You choose the Postgres version (14--17), instance size (small maps to db.t3.medium on AWS, medium to db.r7g.large, large to db.r7g.xlarge -- with equivalent tiers on GCP and Azure), and backup retention. High availability adds a standby replica with automatic failover.
Outputs include host, port, connectionString, and credentials. Other installations in the same environment can reference these outputs to connect without manual configuration.
To use your own encryption key, the key must already exist in the environment's region and the database service must be able to use it: on AWS the KMS key policy must allow the provisioning role kms:DescribeKey and kms:CreateGrant; on GCP the Cloud SQL service agent needs roles/cloudkms.cryptoKeyEncrypterDecrypter on the key; on Azure a user-assigned identity with the Key Vault Crypto Service Encryption User role is required. The key is fixed at creation time and changing it later replaces the instance.
This blueprint accepts 23 configurable inputs to customize the installation for your environment.
nodeGroupstringValue of the `ryvn.app/node-group-name` label for the database user provisioner and metrics exporter pods. Leave blank to omit this node selector. Does not affect the managed database or Tailscale proxies.
tolerationsstringYAML list of Kubernetes tolerations for the database user provisioner and metrics exporter pods. Leave blank to retain chart defaults. Does not affect the managed database or Tailscale proxies.
versionstringPostgres major version.
sizestringInstance size. Small is suitable for development and low-traffic workloads, medium for most production workloads, and large for higher-throughput or memory-intensive workloads.
storageGBnumberInitial storage in GB. Storage scales up automatically as needed but cannot be decreased. Azure values below 32 GiB are set to 32.
highAvailabilitybooleanDeploy a standby replica with automatic failover. Recommended for production workloads.
databaseNamestringName of the database to create.
usernamestringUsername for the database.
passwordstringMaster password for the database. Minimum 8 characters.
backupRetentionDaysnumberNumber of days to retain automated backups. Set to 0 to disable automated backups on AWS and GCP. Azure requires 7-35 days and will reject 0.
deletionProtectionbooleanProtects the database from accidental destruction. Disable before tearing down an environment.
encryptionKeyIdstringCustomer-managed encryption key for data at rest (KMS key ARN on AWS, Cloud KMS key on GCP, Key Vault key on Azure). Leave blank to use the cloud provider's managed keys.
encryptionKeyIdentityIdstringUser-assigned managed identity the server uses to access the Key Vault key. Required with an encryption key on Azure.
enableReadOnlyUserbooleanProvision an additional Postgres role with SELECT on all tables in the public schema, including future tables created by the master user. Useful for analytics and BI tools.
readOnlyUsernamestringUsername for the read-only role. Lowercase letters, digits, and underscores only.
readOnlyPasswordstringPassword for the read-only user. Minimum 8 characters.
enableReadWriteUserbooleanProvision an additional Postgres role with SELECT/INSERT/UPDATE/DELETE on all tables in the public schema, plus matching default privileges so future tables are covered. Useful for application services that should not run with master credentials.
readWriteUsernamestringUsername for the read-write role. Lowercase letters, digits, and underscores only.
readWritePasswordstringPassword for the read-write user. Minimum 8 characters.
enableMetricsbooleanCollect Postgres engine metrics such as connections, transaction and tuple rates, cache hit ratio, locks and database size. Provisions a dedicated monitoring role, which can read Postgres statistics only, never your data, and runs a small exporter pod in your cluster that scrapes the database.
monitorUsernamestringUsername for the monitoring role. Lowercase letters, digits, and underscores only.
monitorPasswordstringPassword for the monitoring role. Minimum 8 characters.
exposeToTailnetbooleanExpose the Postgres host to your Tailnet using Tailscale. Where the database has a DNS endpoint (AWS, Azure) it becomes reachable under a hostname derived from the installation and environment name; where it has only a private IP (GCP Cloud SQL) a subnet router advertises the host and the advertised route must be approved in your Tailnet. Requires the Tailscale operator to already be installed in the environment.
This blueprint exposes 13 outputs that other services can reference.
hoststringHostname for connecting to the database from other services.
portnumberPort number for database connections (typically 5432).
endpointstringConnection endpoint in host:port format.
databaseNamestringName of the created database.
usernamestringUsername for database authentication.
passwordstringMaster password for database authentication.
connectionStringstringFull connection string in postgresql://user:pass@host:port/db?sslmode=require format. SSL is required for connections.
readOnlyUsernamestringUsername of the read-only role.
readOnlyPasswordstringPassword for the read-only role.
readOnlyConnectionStringstringConnection string for the read-only role.
readWriteUsernamestringUsername of the read-write role.
readWritePasswordstringPassword for the read-write role.
readWriteConnectionStringstringConnection string for the read-write role.