Externalized Configuration with Spring Cloud Config and Vault

You start a new project. In the beginning, it’s mostly prototyping; you try out ideas and nothing is fixed yet, so you are very pragmatic when it comes to the configuration of your application. Some property files are stored next to the source code – at least you are not using hard-coded URLs and credentials! When you first deploy the application to a dev or demo environment, you simply copy and modify the property files. The prototype turns into production code, yet the configuration is still managed in an ad-hoc manner. Does this sound familiar to you? It was, at any rate, the situation I found myself in with one my of current projects somewhat more than a year ago.

Maintaining separate copies of the configuration files in different environments was probably never the best approach, even when we used to deploy onto few long-running snowflake servers. Given that we more and more learn to take advantage of cloud offerings, therefore often create short-lived application environments for, e.g., tests, and deploy even our production systems as phoenix servers, we need to do better.

Read this article if you want to find out how Haufe approached this issue in one of their Spring Boot-based projects using Spring Cloud Config and Spring Cloud Vault and how they customized these libraries to meet their needs.