Templating ΒΆ

In nais/deploy we use Handlebars 3.0 syntax as templating language. Both the template and variable file supports either YAML or JSON syntax.

A practical example follows. Create a nais.yaml file:

yaml

Now, create a vars.yaml file containing variables for your deployment:

yaml

Run the nais validate tool to see the final results:

bash

Escaping and raw resources ΒΆ

If you do not specify the --vars or --var command-line flags, your resource will not be run through the templating engine, so these resources will not need templating.

Handlebars content may be escaped by prefixing a mustache block with \, such as:

Plaintext

Real-world example:

yaml

Info

Templating will not be run if you do not use VARS and/or VAR, meaning \{{escaped}} will not be handled by nais/deploy.