Skip to content

Instantly share code, notes, and snippets.

@joemiller
Created April 5, 2022 23:41
Show Gist options
  • Save joemiller/4c4e22c0795134c5ad7088bc822ae82c to your computer and use it in GitHub Desktop.
Save joemiller/4c4e22c0795134c5ad7088bc822ae82c to your computer and use it in GitHub Desktop.
vault kv allows for a key to both contain data and have subkeys
$ vault server -dev -dev-root-token-id=root &
$ VAULT_ADDR='http://127.0.0.1:8200' VAULT_TOKEN=root vault kv put secret/foo bar=baz quux=blah
$ VAULT_ADDR='http://127.0.0.1:8200' VAULT_TOKEN=root vault kv put secret/foo/subkey blah=blah
$ VAULT_ADDR='http://127.0.0.1:8200' VAULT_TOKEN=root vault kv list secret/
Keys
----
foo
foo/
$ VAULT_ADDR='http://127.0.0.1:8200' VAULT_TOKEN=root vault kv get secret/foo
Key Value
--- -----
bar baz
quux blah
$ VAULT_ADDR='http://127.0.0.1:8200' VAULT_TOKEN=root vault kv get secret/foo/subkey
Key Value
--- -----
blah blah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment