How to do it...

In order to demonstrate using Vault to securely store sensitive configuration data, we'll first create an attachment service that stores sensitive information using environment variables. We'll then integrate Vault so that the same configuration is read from a secure store:

  1. Create a new Java project called attachment-service with the following build.gradle file:
group 'com.packtpub.microservices'version '1.0-SNAPSHOT'buildscript {    repositories {        mavenCentral()    }    dependencies {        classpath group: 'org.springframework.boot', name: 'spring-boot-gradle-plugin', version: '1.5.9.RELEASE'    }}apply plugin: 'java'apply plugin: 'org.springframework.boot'apply plugin: 'io.spring.dependency-management'sourceCompatibility = 1.8repositories ...

Get Microservices Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.