Template
The Template resource allows the processing of templates, outputing the result as a file.
Templating uses the Handlebars language which is Mustache template language can be found at the following location: Mustache templating language details.
Template Functions
The template resource provides custom functions that can be used inside your templates as shown in the example below.
quote [string]
Returns the original string wrapped in quotations, quote can be used with the Go template pipe modifier.
trim [string]
Removes whitespace such as carrige returns and spaces from the begining and the end of the string, can be used with the Go template pipe modifier.
Attributes
Attributes are the properties of a resource that can be used to configure it.
Source source
required
string
Local path to the template source file
Destination destination
required
string
The destination to write the processed template to.
Variables to use with the template, variables are available to be used within the template using the `go template` syntax.
Given the above variables, these could be used within a template with the following convention.
Computed Attributes
These attributes are computed when the config is parsed and applied, and are therefor only known at parsetime or runtime.
Meta ID meta.id
string
The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:
Meta Type meta.type
string
The type of the resource. This taken from the type label of the resource definition.
Meta Name meta.name
string
The name of the resource. This taken from the name label of the resource definition.
Examples
Template using HereDoc
External Files
Inline variables
Last updated