hashicorp-settings v2.1.0
Hashicorp Configuration Tool
This tool reads several values from hashicorp consul/vault, and outputs them to one of several output formats, depending on the given settings file and cli arguments
Settings file
The settings file should be a valid JSON file
with a settings
property. This should be an
array of objects, each with a path to get from
consul/vault, and a key which will be the
key for that value in the output
Example
{
"settings": [
{
"path": "secret/batman/web/foo/abc",
"key": "alphabet"
},
{
"path": "secret/batman/web/foo/hello",
"key": "classic"
},
{
"path": "secret/batman/web/bar/baz",
"key": "bar-key"
}
]
}
Vault Caveat
This tool aims to be isomorphic between its operations
with consul and vault, however, the services have a difference
in that in consul, a path resolves to a value, and in vault, a
path resolves to a key value store. To get around this, when
working with vault, the path actually retrieved from vault is
the path up until the last seperator (/
). The last token in the
path is then used as the key to grab from that key value.
In the above example, the first example grabs secret/batman/web/foo
from vault, then stores the key abc
from that vk store in the alphabet
key in the output
CLI documentation
run hashicorp-configuration write -h
TODO
- Throw different errors for 404s/auth fails for vault/consul
- Fix flow config to handle dependencies correctly
7 years ago