postgresql
The postgresql service deploys a single node PostgreSQL database instance with pgBackRest powered backup. PostgreSQL major versions 14 to 18 are supported, the default is 17.
Databases and their users are managed via the databases list. Strong credentials are generated for all users and automatically stored in the configured secret provider. Databases that are removed from the list will not be deleted automatically.
Users
For every database a default user with full access is created, named after the database. Additional users can be declared in the users list of a database with permissions controlled via the admin, read and write flags
admingrants full DDL privileges on the databasereadgrants select access to all tableswritegrants insert, update and delete access to all tables and usage of all sequences
Permissions also cover tables created after the user was provisioned, and are re-applied on every apply, so removing a flag revokes the associated privileges. Users that are removed from the list are not deleted automatically. Each user can only be assigned to a single database, and user names must not collide with database names.
Required Providers
A cloud provider (hcloud), a backup provider (backup_local or backup_aws_s3) and a secret provider (pass or protonpass).
Example
See the configuration format for the full keyword reference.