I have a configuration class with VaultPropertySource
annotation similar to the following that works great in environments that have access to Vault.
@Configuration
@VaultPropertySource("secret/my-application")
public class AppConfig {
@Value(${redis.password:default})
private String password
}
The issue is that some deployments will not have access to Vault. In my bootstrap.yml
I have set spring.cloud.vault.enabled = false
but I get
Application failed to start - A component required a been named 'vaultTemplate' that could not be found.
At this point, I can comment out the VaultPropertySource
and it works. What can I do in these environments without Vault without having to comment out VaultPropertySource
?