Skip to content

Commit

Permalink
docs: add pkiCert example on agent template docs (#15836)
Browse files Browse the repository at this point in the history
  • Loading branch information
calvn authored Jun 7, 2022
1 parent cf5c820 commit 06c5635
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions website/content/docs/agent/template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06c5635

Please sign in to comment.