LogstashMarkersJsonProvider
?
Hi all, I have a Spring Boot application that I've deployed to Google App Engine. I'm trying to configure it to use secrets stored in GCP Secret Manager. I've added spring-cloud-gcp-starter-secretmanager:2.0.0
to my project and added this property to my application.ymldatabase-name: ${sm://projects/<my-project>/secrets/db-name}
However I know the secret isn't getting resolved because when I deploy and run the app, I see this in the logsorg.postgresql.util.PSQLException: FATAL: database "//projects/<my-project>/secrets/db-name" does not exist
I don't see any output specific to secretmanager, so I can't tell if I've misconfigured something and secretmanager isn't even getting invoked, or if it is getting invoked, and simply can't resolve the secret. I'm using the default properties listed here: https://cloud.spring.io/spring-cloud-static/spring-cloud-gcp/current/reference/html/#configuration-10 and I've already verified that my GAE service account has the correct access to the secrets.
Anyone know what the output I'm seeing might indicate? Thanks in advance.
@meltsufin Thank you. I need to make a correction to my post above though. It turns out my secrets in application.yml are getting resolved just fine. However I should have stated that the following configuration is located in bootstrap.yml
database-name: ${sm://projects/<my-project>/secrets/db-name}
So it's the secret in bootstrap.yml that's not getting resolved. I would rather add this configuration to application.yml and then I suspect all would be well. The problem is when I add the spring-cloud-gcp-starter-secretmanager:2.0.0
dependency to my project, I get this error when I try to run:
java.lang.IllegalArgumentException: A database name must be provided.
It seems that it wants the spring.cloud.gcp.sql.database-name
property defined in bootstrap.yml. When I move that configuration there, the app runs again. However, it seems I can't resolve the secret in bootstrap.yml.
Any idea why it wants database-name
defined in bootstrap.yml? Thanks again
spring-cloud-gcp-starter-data-firestore
library using Gradle. I created a project using start.spring.io which seems to have included the correct dependency management config, but when I try to use Firestore classes (e.g. FirestoreTemplate
), none of them can be found. The entire com.google.cloud.spring.data
package can't be found at all.
@wjohnst3 -- Hey, unfortunately right now the best we can do for defaulting is related to environment variables: example.secret=${MY_ENV_VARIABLE:${sm://application-secret/latest}}
i.e. if MY_ENV_VARIABLE
is set, use that, else use the secret.
We can try to support your use-case though. So in this case, if sm://my-secrete
does not exist, you want to default to empty string?
hi, we just worked out all the terraform necessary to provision a spring cloud eureka server on GCP. anybody at google or elsewhere have a place where we could post a blog or guide on how to do this? wasn’t obvious.
I think GCP Community could be great place for something like this. See: https://cloud.google.com/community/tutorials/write
Hi all, I have an application that needs to read from a GCP Firestore (native mode) database. I would like to use Spring Data repositories, however the only Repository interface I'm able to find for native mode is FirestoreReactiveRepository
.
The problem is that my application is non-reactive and I need the ability to access another non-reactive relational db. When I try to add spring-boot-starter-data-jpa
to my project, I get the following error:Reactive Repositories are not supported by JPA. Offending repository is <MyRepositoryWhichExtendsFiretoreReactiveRepository>
Does anyone know of another way to use Spring Data Repositories with Firestore in native mode bedsides using FirestoreReactiveRepository
? Thanks in advance!
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project spring-cloud-gcp-storage: Compilation failure
[ERROR] /home/spencer/workspace/spring/spring-cloud-gcp/spring-cloud-gcp-storage/src/main/java/org/springframework/cloud/gcp/storage/integration/filters/GcsPersistentAcceptOnceFileListFilter.java:[31,8] org.springframework.cloud.gcp.storage.integration.filters.GcsPersistentAcceptOnceFileListFilter is not abstract and does not override abstract method isDirectory(com.google.cloud.storage.BlobInfo) in org.springframework.integration.file.filters.AbstractDirectoryAwareFileListFilter
org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration
Failing for the past 11 builds (Since Failed#1 )
Took 2 min 16 sec.
add description
Error Message
I/O error
Stacktrace
com.google.cloud.datastore.DatastoreException: I/O error
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.lambda$testDatastoreEmulatorConfiguration$1(GcpDatastoreEmulatorIntegrationTests.java:88)
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration(GcpDatastoreEmulatorIntegrationTests.java:76)
Caused by: com.google.datastore.v1.client.DatastoreException: I/O error
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.lambda$testDatastoreEmulatorConfiguration$1(GcpDatastoreEmulatorIntegrationTests.java:88)
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration(GcpDatastoreEmulatorIntegrationTests.java:76)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.lambda$testDatastoreEmulatorConfiguration$1(GcpDatastoreEmulatorIntegrationTests.java:88)
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration(GcpDatastoreEmulatorIntegrationTests.java:76)