terranova icon indicating copy to clipboard operation
terranova copied to clipboard

[Feature] Go templates

Open johandry opened this issue 5 years ago • 1 comments

Is your feature request related to a problem? Please describe. The TF code works but I'd like to make it a Go template to do things that at this time HCL don't allow me to do.

Describe the solution you'd like Instead of passing a static TF code, pass a Go template with the values to render it.

Describe alternatives you've considered Render the code before pass it to Terraformer.

Proposal Allow to receive a Go template and a map with the values. This could be in the New function or in a Parse function or both.

Additional context Notice that the character used by Go templates by default is also used in HCL. We may consider to use a different character to make is more human readable.

References

johandry avatar Oct 05 '19 06:10 johandry

Go Templates and Terranova is documented in the example 06 on the Terranova-Examples repo: https://github.com/johandry/terranova-examples/tree/master/06_templates.

At this time I'm not sure if this should be a feature on Terranova, I think it will add more complexity to the module/package, so maybe keep the package simple to do what is was meat to do.

The Go Templates & Terranova feature may be a external package or documented as an example.

I'll appreciate your comments on this topic.

johandry avatar Oct 20 '20 01:10 johandry