Issue
I followed the documentation https://docs.spring.io/spring-cloud-gcp/docs/current/reference/html/secretmanager.html#_secret_manager_property_source and the bootstrap.yml file looks like this:
spring:
clouds:
gcp:
secret manager:
enabled: true
secret-name-prefix: "sm://"
project-id: my-project-id
data source:
username: "${sm://datasource-username}"
password: test
and the application.yml file looks like this:
spring:
clouds:
gcp:
projectId: my-project-id
SQL:
instance-connection-name: "my-instance"
databaseName: testDatabase
and I get this error:
Property: spring.datasource.username\n Value: ${sm://datasource-username}\n Origin: class path resource [bootstrap.yml] - 9:15\n
Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [com.google.protobuf.ByteString$LiteralByteString] to type [java.lang.String]\n\nAction:\n\nUpdate your application's configuration\n"}
I don't really understand what I'm doing wrong :( I think I need a converter(.toStringUtf8()) in bootstrap.yml, but I don't no how to implement a converter in yml file. Any idea is helpful, thanks a lot
Solution
I used this dependency and it worked:
implementation("com.google.cloud:spring-cloud-gcp-starter-secretmanager:3.2.1")
Answered By - Rrram06
Answer Checked By - Pedro (JavaFixing Volunteer)