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

docs: add pkiCert example on agent template docs #15836

Merged
merged 1 commit into from
Jun 7, 2022
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
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