Spring Vault Examples
Open a console in the examples root directory and execute the following commands to setup Vault:
$ src/test/bash/create_certificates.sh # Create SSL certificates $ src/test/bash/install_vault.sh # Download and unzip vault $ src/test/bash/local_run_vault.sh &
Vault is now running in dev-mode listening on https://localhost:8200 and http://localhost:8201.
Vault requires some configuration before you can run the examples.
$ source src/test/bash/env.sh $ src/test/bash/setup_examples.sh
The root token is set to
and Vault is running in dev mode.
You can use Vault now from the console or run the examples. Check out the example-specific readme's for further instructions/requirements.
Vault runs with SSL enabled so make sure the application runs
in the current directory so it can find
Using Vault from the Command Line
You can use a shortcut to setup the token and Vault CLI environment by sourcing
$ source src/test/bash/env.sh # Set Vault address, Token and CA path
Write Data to Vault
Writes the key-value pair
mykey=value to the path
$ ./vault write secret/my-spring-boot-app mykey=value