Closed hugespoon closed 4 years ago
Thanks for pointing this out.
The HCL2 spec says The template expression ends when the given identifier subsequently appears again on a line of its own.
in the heredoc section https://github.com/hashicorp/hcl2/blob/master/hcl/hclsyntax/spec.md#template-expressions
That seems to mean that the terminator has to appear on a new line by itself. Let me know if I'm reading that wrong
I think you are right. I was using this on some TF 0.11.x (which doesn't use HCL2) where this was valid. Apologies for the mistake!
It looks like when using a HEREDOC and ending it on the same line as another character, the parser does not properly detect the end of the doc and will lump the next resource in as well. Example:
In this case, the 'policy' key in the dictionary will contain both the 'policy' and 'redrive_policy' information. Moving the first 'POLICY' HEREDOC terminator to its own line fixes this issue.