I am running a Docker Vault container
in dev
mode, and I can't read a secret located at /secret/mobsters/
called password
.
Here are Spring logs.
Running vault kv get secret/mobsters
returns the password key value pair. I can also access the vault server locally.
Here is how I am referencing the secret:
@Value("${password}")
String password;
@PostConstruct
private void postConstruct() {
System.out.println("My password is: " + password);
}
The Spring Cloud Vault
configuration is setup using a bootstrap.yml
file:
spring.application.name: mobsters
spring.cloud.vault:
host: localhost
port: 8200
scheme: http
authentication: TOKEN
token: ...
I am getting an exception with the message (full exception here):
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'password' in value "${password}"`
From Vault UI: