InfluxDB is one of the supported plugins for the database secrets engine. This
plugin generates database credentials dynamically based on configured roles for
the InfluxDB database.
See the database secrets engine docs for
more information about setting up the database secrets engine.
Configure a role that maps a name in Vault to an SQL statement to execute to
create the database credential:
$ vault write database/roles/my-role \
db_name=my-influxdb-database \
creation_statements="CREATE USER \"{{username}}\" WITH PASSWORD '{{password}}'; \
GRANT ALL ON \"vault\" TO \"{{username}}\";" \
default_ttl="1h" \
max_ttl="24h"
Success! Data written to: database/roles/my-role
$ vault write database/roles/my-role \ db_name=my-influxdb-database \ creation_statements="CREATE USER \"{{username}}\" WITH PASSWORD '{{password}}'; \ GRANT ALL ON \"vault\" TO \"{{username}}\";" \ default_ttl="1h" \ max_ttl="24h"Success! Data written to: database/roles/my-role