hairyhenderson/gomplate

Evaluate implementation of HCL support

RafPe opened this issue · 3 comments

Recently I am investigating using custom templating of terraform modules with the use of gomplate - hence end result is HCL.

Up to certain moment I have been able to leverage on just using YAML and template definitions however in more complex scenarios this simple setup does not work anymore.

Back in the days it has been requested via #839 however due to lack of interest did not move anywhere.

Right now I kinda worked around the setup by:

This solution has a lot of moving parts and I am also afraid it does not always properly deliver HCL formatted results.

Thats why - from engineer perspective I would say having something like {{ .somedata | data.ToHCL }} would be a great addition to this tool :)

Thanks for filing this @RafPe. Just to be clear - you're looking specifically for rendering support for HCL for use in Terraform, and not parsing support?

That may be possible. There's some discussion in hashicorp/hcl#375 about why parsing is quite a bit more complex.

I'm open to this feature being contributed, but I don't have the bandwidth to write it myself. If you're open to working on a PR for a data.ToHCL function, I'd review it...

Hi @hairyhenderson - I only want to support rendering HCL to use the given objects in Terraform.

Would you have some tips for getting that going into the code :) ?

This issue is stale because it has been open for 60 days with no
activity. If it is no longer relevant or necessary, please close it.
Given no action, it will be closed in 14 days.

If it's still relevant, one of the following will remove the stale
marking:

  • A maintainer can add this issue to a milestone to indicate that
    it's been accepted and will be worked on
  • A maintainer can remove the stale label
  • Anyone can post an update or other comment