Configure HashiCorp Vault's database secrets engine to issue short-lived, auto-expiring PostgreSQL credentials to applications

domain: developer.hashicorp.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Enable the database secrets engine on a Vault mount path.
  2. Configure the PostgreSQL connection, supplying the plugin name, connection URL, and a Vault-managed admin credential used to create dynamic users; optionally enable root credential rotation so Vault owns that admin credential going forward.
  3. Create a role that maps a Vault role name to a creation SQL statement (granting login and a generated password with an expiration) plus default_ttl and max_ttl values controlling lease lifetime.
  4. Applications request credentials by reading the role's creds path, receiving a unique username/password pair and a lease ID scoped to default_ttl.
  5. Vault automatically revokes the database user when the lease expires or is explicitly revoked; clients should renew the lease before default_ttl elapses rather than assuming a connection stays valid indefinitely.

Known gotchas

Related routes

Configure Vault dynamic database credentials for PostgreSQL
developer.hashicorp.com · 6 steps · unrated
Issue dynamic database credentials from HashiCorp Vault for MySQL
developer.hashicorp.com · 6 steps · unrated
Issue TLS certificates from HashiCorp Vault PKI secrets engine as an intermediate CA
developer.hashicorp.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans