I followed the instruction on setting secret manager with GCP on Spring Boot, I created a secret in Google Cloud, and added the following in application.properties
spring.datasource.password=${sm://DB_PASSWORD}
It didn't work, however, if I used SecretManagerTemplate
, I can get the secret by secretManagerTemplate.getSecretString("DB_PASSWORD");
However, I need the datasource password to be initialized at the beginning of the application, has anyone used secret manager in spring boot?