From 7d03c2ab673f9d6b90a89e486981f9cd5b61451b Mon Sep 17 00:00:00 2001 From: Calvin Leung Huang <1883212+calvn@users.noreply.github.com> Date: Mon, 6 Jun 2022 14:40:01 -0700 Subject: [PATCH] docs: add pkiCert example on agent template docs --- website/content/docs/agent/template.mdx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/website/content/docs/agent/template.mdx b/website/content/docs/agent/template.mdx index b121e9200503..4208c44fbea8 100644 --- a/website/content/docs/agent/template.mdx +++ b/website/content/docs/agent/template.mdx @@ -45,17 +45,25 @@ The following links contain additional resources for the templating language use ### Template Language Example -Template with Vault Agent requires the use of the `secret` [function from Consul -Template](https://github.com/hashicorp/consul-template/blob/master/docs/templating-language.md#secret). +Template with Vault Agent requires the use of the `secret` [function](https://github.com/hashicorp/consul-template/blob/master/docs/templating-language.md#secret) +or `pkiCert` [function](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md#pkicert) +from Consul Template. + The following is an example of a template that retrieves a generic secret from Vault's KV store: - ``` {{ with secret "secret/my-secret" }} {{ .Data.data.foo }} {{ end }} ``` +The following is an example of a template that retrieves a PKI certificate from +Vault's PKI secrets engine. The fetching of a certificate from a PKI role +through this function will be based on the certificate's expiration. +``` +{{ pkiCert "pki/issue/my-domain-dot-com" "common_name=foo.example.com" }} +``` + ## Global Configurations The top level `template_config` block has the following configuration entries that affect