This guide demonstrates how to configure a Spring Boot application to use HashiCorp Vault for secrets in remote environments (e.g., prod, staging, integration) while avoiding Vault entirely in local environments (dev, test), using only one main configuration file and minimal profile-specific overrides. ✅ Goals Use only one main application.properties file Avoid Vault in dev and test profiles Enable Vault by default for all other environments Support dynamic Vault paths like secret/prod/vault-demo Manage Vault and Spring behavior with environment variables Provide launcher classes for local testing with dev or test profile

Apr 15, 2025 - 21:06
 0

This guide demonstrates how to configure a Spring Boot application to use HashiCorp Vault for secrets in remote environments (e.g., prod, staging, integration) while avoiding Vault entirely in local environments (dev, test), using only one main configuration file and minimal profile-specific overrides.

✅ Goals

  • Use only one main application.properties file
  • Avoid Vault in dev and test profiles
  • Enable Vault by default for all other environments
  • Support dynamic Vault paths like secret/prod/vault-demo
  • Manage Vault and Spring behavior with environment variables
  • Provide launcher classes for local testing with dev or test profile