hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.

Home Page:http://www.packer.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document string templates

lindhe opened this issue · comments

It says in the docs when describing template sequences that "These are described in more detail in the following section", but then it's barely expanded upon in the next section:

In both quoted and heredoc string expressions, Packer supports template
sequences that begin with `${` and `%{`. These are described in more detail
in the following section. To include these sequences _literally_ without
beginning a template sequence, double the leading character: `$${` or `%%{`.
## String Templates
Within quoted and heredoc string expressions, the sequences `${` and `%{` begin
_template sequences_. Templates let you directly embed expressions into a string
literal, to dynamically construct strings from other values.

We should probably try and expand that section. I'm guessing we can draw heavily on the corresponding docs for Terraform, but it would be nice if someone could confirm that Packer supports the same string template syntax as Terraform.