mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-03 12:07:54 +00:00
docs: add multi-host connection string info to postgres secrets API docs (#16780)
* Add multihost connection string information to postgres API docs * Add note about replication manager
This commit is contained in:
@@ -32,7 +32,7 @@ options, including SSL options, can be found in the [pgx][pgxlib] and
|
||||
|
||||
1. Enable the database secrets engine if it is not already enabled:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ vault secrets enable database
|
||||
Success! Enabled the database secrets engine at: database/
|
||||
```
|
||||
@@ -42,9 +42,9 @@ options, including SSL options, can be found in the [pgx][pgxlib] and
|
||||
|
||||
1. Configure Vault with the proper plugin and connection information:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ vault write database/config/my-postgresql-database \
|
||||
plugin_name=postgresql-database-plugin \
|
||||
plugin_name="postgresql-database-plugin" \
|
||||
allowed_roles="my-role" \
|
||||
connection_url="postgresql://{{username}}:{{password}}@localhost:5432/" \
|
||||
username="vaultuser" \
|
||||
@@ -54,9 +54,9 @@ options, including SSL options, can be found in the [pgx][pgxlib] and
|
||||
1. Configure a role that maps a name in Vault to an SQL statement to execute to
|
||||
create the database credential:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ vault write database/roles/my-role \
|
||||
db_name=my-postgresql-database \
|
||||
db_name="my-postgresql-database" \
|
||||
creation_statements="CREATE ROLE \"{{name}}\" WITH LOGIN PASSWORD '{{password}}' VALID UNTIL '{{expiration}}'; \
|
||||
GRANT SELECT ON ALL TABLES IN SCHEMA public TO \"{{name}}\";" \
|
||||
default_ttl="1h" \
|
||||
@@ -72,7 +72,7 @@ the proper permission, it can generate credentials.
|
||||
1. Generate a new credential by reading from the `/creds` endpoint with the name
|
||||
of the role:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ vault read database/creds/my-role
|
||||
Key Value
|
||||
--- -----
|
||||
|
||||
Reference in New Issue
Block a user