Skip to content

Databases — Requesting a database

Request a database in the DevOps portal. The portal opens a merge request adding a file like this to GitLab infrastructure/databases:

# teams/<team>/orders-prod.yaml
name: orders
owner: <team>
env: prod              # dev | qa | prod
engine: postgres
cluster: psql-prod

When it merges you get:

  • a database and login role named <name>_<env> (e.g. orders_prod),
  • credentials in OpenBao at apps/<team>/postgres-<env>/<name>: host, port, ro_port, database, username, password, sslmode, uri.

Using it from your app

Allow your namespace to read the team's postgres-<env> vault (portal → Secrets), then in your app's config:

secrets: [{env: DATABASE_URL, vault: postgres-prod, item: orders, key: uri}]

In the portal's app form that's a secret with vault postgres-prod, item orders, key uri (Applications). The form suggests the key names when you can read the item. Developers can't read postgres-prod, so in production type the key yourself.

Removing a database

Deleting the request doesn't drop anything. To drop a database, mark it for purge in the portal: it's backed up (kept 30 days), then dropped along with its credentials. Prod purges need a platform engineer to approve.