Spring Cloud Vault Config provides client-side support for externalized configuration in a distributed system. With HashiCorp Vault you have a central place to manage external secret properties for applications across all environments. Vault can manage static and dynamic secrets such as username/password for remote applications/resources and provide credentials for external services such as MySQL, PostgreSQL, Apache Cassandra, MongoDB, Consul, AWS and more.
Read: https://cloud.spring.io/spring-cloud-vault/
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-vault-config</artifactId>
</dependency>
Configure the Vault connection in bootstrap.properties
.
Discover Vault instance using Spring Cloud Kubernetes
spring.cloud.vault.enabled=true
spring.cloud.vault.discovery.enabled=false
spring.cloud.vault.token=s.4fhaikfwiugibfi38guibfav8
spring.cloud.vault.scheme=http
# FQDN direct uri http://{serviceId}.{namespace}:{port}
spring.cloud.vault.uri=http://vault-vault.vault:8200
Note: Useful for local profile
spring.cloud.vault.enabled=false
spring.cloud.config.discovery.enabled=false