I am running a Mirconaut application on GCP cloud with Cloud sql database running on a private ip.
DB password is stored in GCP cloud secrets, I need to load the secret before creating connection to DB
I have followed the guide here: https://micronaut-projects.github.io/micronaut-gcp/3.4.0/guide/index.html#secretManager
but the secret is never preloaded for me.
Here is how my bootstrap.yml looks like:
micronaut:
application:
name: test
config-client:
enabled: true
gcp:
secret-manager:
keys:
- db-user-password
and here is my application.yml db config:
micronaut:
application:
name: test
config-client:
enabled: true
datasources:
default:
url: jdbc:postgresql:///test?cloudSqlInstance=testcloudSqlInstance&socketFactory=com.google.cloud.sql.postgres.SocketFactory
name: test
username: user
password: ${sm.db-user-password}
dialect: POSTGRES
maximumPoolSize: 15
minimumIdle: 5
jpa:
default:
packages-to-scan:
- "com.test"
entity-scan:
packages: 'com.test'
properties:
hibernate:
hbm2ddl:
auto: none
show_sql: false
liquibase:
datasources:
default:
enabled: true
dropFirst: false
defaultSchema: public
change-log: 'liquibase-changelog.xml'
Micronaut version: 2.3.2 Micronaut gcp version: 3.4.0