5 Controlling your configuration with the Spring Cloud Configuration Server

 

This chapter covers

  • Separating the service configuration from the service code
  • Configuring a Spring Cloud Configuration Server
  • Integrating a Spring Boot microservice with a configuration server
  • Encrypting sensitive properties
  • Integrating the Spring Cloud Configuration Server with HashiCorp Vault

Software developers always hear about the importance of keeping the application configuration separate from the code. In most scenarios, this means not using hardcoded values in the code. Forgetting this principle can make changing an application more complicated because every time a change to the configuration is made, the application has to be recompiled and/or redeployed.

Completely separating the configuration information from the application code allows developers and operations to make changes to their configurations without going through a recompile process. But it also introduces complexity, because now developers have another artifact to manage and deploy with the application.

5.1 On managing configuration (and complexity)

5.1.1 Your configuration management architecture

5.1.2 Implementation choices

5.2 Building our Spring Cloud Configuration Server

5.2.1 Setting up the Spring Cloud Config bootstrap class

5.2.2 Using the Spring Cloud Config Server with a filesystem

5.2.3 Setting up the configuration files for a service

5.3 Integrating Spring Cloud Config with a Spring Boot client

5.3.1 Setting up the licensing service Spring Cloud Config Service dependencies

5.3.2 Configuring the licensing service to use Spring Cloud Config

5.3.3 Wiring in a data source using Spring Cloud Config Server

5.3.4 Directly reading properties using @ConfigurationProperties

5.3.5 Refreshing your properties using Spring Cloud Config Server

5.3.6 Using Spring Cloud Configuration Server with Git

5.3.7 Integrating Vault with the Spring Cloud Config service

5.3.8 Vault UI

5.4 Protecting sensitive configuration information