Is it possible to use HCL2 functions in a heredoc?
template {
change_mode = "noop"
destination = "${NOMAD_TASK_DIR}/config.yaml"
data = <<-EOT
- vault_hostname: "substr({{ env "VAULT_ADDR" }}, 8, strlen({{ env "VAULT_ADDR" }}))"
EOT
}
Returns an error:
err="parsing YAML file /local/config.yaml: \"substr(https://vault.hostname.com:8200, 8, strlen(https://vault.hostname.com:8200))\" is not a valid hostname"