I have MULTIPLE Postgres servers where I want to control the access using a SINGLE Vault instance.
how to load the Postgres module
$ vault mount postgresql
then how to set the "super_user" (or so) credentials and URL
then how to define a role
$ vault write postgresql/roles/readonly \
sql="CREATE ROLE \"{{name}}\" WITH LOGIN PASSWORD '{{password}}' VALID UNTIL '{{expiration}}';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO \"{{name}}\";"
then how to create a user
$ vault read postgresql/creds/readonly
Fine but I want to configure multiple databases, each with multiple roles, all of this in a single Vault instance.
Is there a syntax for that? I see nothing obvious in the doc to "name" a database then use it creating the TTL setting or creating a role for this database
I also want to be able to control the access to the different roles/databases based on some policy.
Can I do that?
My question is for Postgres but I did not find any clue on how to support it.
The documentation for the other database secret backends did not help either.
If you cannot do it, it seriously impairs the use of Vault with databases.
Installing multiple Vault instance is not really an option.
Thanks
Olivier