From 7a16088eeb7490977a41390ec93e9eeafa2eec8b Mon Sep 17 00:00:00 2001 From: Stuart Clark Date: Sun, 6 Aug 2017 03:20:34 +0100 Subject: Vault write support (#183) * Add write support for Vault to enable the use of dynamic secrets --- docs/content/functions/general.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs') diff --git a/docs/content/functions/general.md b/docs/content/functions/general.md index d04e8cc6..8a8802a1 100644 --- a/docs/content/functions/general.md +++ b/docs/content/functions/general.md @@ -627,6 +627,16 @@ $ echo 'db_password={{(datasource "vault" "db/pass").value}}' \ db_password=prodsecret ``` +It is also possible to use dynamic secrets by using the write capibility of the datasource. To use +add an additional query string style section to the optional key name (i.e. +`"key?name=value&name=value"`). These values are then included within the JSON body of the request. + +```console +$ echo 'otp={{(datasource "vault" "ssh/creds/test?ip=10.1.2.3&username=user").key}}' \ + | gomplate -d vault=vault:/// +otp=604a4bd5-7afd-30a2-d2d8-80c4aebc6183 +``` + ## `datasourceExists` Tests whether or not a given datasource was defined on the commandline (with the -- cgit v1.2.3