-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Description
Describe the bug
When using cloud.vault.databases to configure multiple datasources, it appears that username/password datasource properties don't get set if more than one entry refers to the same vault database role.
Our use case is an application that uses 2 separate databases in some environments, while in other environments rather than using 2 different databases, the application uses 2 different schemas co-located in the same database.
Spring cloud version: 2025.0.0
Sample
Highly abstracted, of course
Does not work:
cloud:
vault:
databases:
primary:
enabled: true
role: db1-dbuser
backend: database/
static-role: true
username-property: spring.datasource.username
password-property: spring.datasource.password
other-database:
enabled: true
role: db1-dbuser
backend: database/
static-role: true
username-property: spring.secondary-datasource.username
password-property: spring.secondary-datasource.password
Works:
cloud:
vault:
databases:
primary:
enabled: true
role: db1-dbuser
backend: database/
static-role: true
username-property: spring.datasource.username
password-property: spring.datasource.password
other-database:
enabled: true
role: db2-dbuser
backend: database/
static-role: true
username-property: spring.secondary-datasource.username
password-property: spring.secondary-datasource.password
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels