Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document the workaround for Vault KV secrets engine - version 2 #1866

Merged
merged 1 commit into from
Oct 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/content/datasources.md
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,10 @@ These are all valid `vault` URLs:
- `vault:///ssh/creds/foo?ip=10.1.2.3&username=user` - create a dynamic secret with the parameters `ip` and `username` provided in the body
- `vault:///secret/configs/` - returns a list of key names with the prefix of `secret/configs/`

### KV secrets engine - version 2 support

A proper support of KV secrets engine - version 2 is coming. In the meanwhile there are workarounds to make it work even now: you need to include an extra `data` segment in the vault URL right after the secret engine mount point, e.g. `vault:///kv2/data/configs/`. Currently it is not possible to retreive a specific secret version.

### Vault Authentication

This table describes the currently-supported authentication mechanisms and how to use them, in order of precedence:
Expand Down Expand Up @@ -691,6 +695,12 @@ In addition to the variables documented [above](#vault-authentication), a number
$ gomplate -d vault=vault:///secret/sneakers -i 'My voice is my passport. {{(datasource "vault").value}}'
My voice is my passport. Verify me.
```
Same for KV secrets engine - version 2 (note the second extra `data` when retreiving the value):

```console
$ gomplate -d vault=vault:///kv2/data/sneakers -i 'My voice is my passport. {{(datasource "vault").data.value}}'
My voice is my passport. Verify me.
```

You can also specify the secret path in the template by omitting the path portion of the URL:

Expand Down