gruntwork-io / boilerplate

A tool for generating files and folders ("boilerplate") from a set of templates
https://www.gruntwork.io
Mozilla Public License 2.0
158 stars 12 forks source link

Introduce a new helper function 'include' #54

Closed yorinasub17 closed 4 years ago

yorinasub17 commented 4 years ago

This introduces include, a new helper function inspired by the same function in helm, which can be used as an alternative to snippet. The function works almost exactly like snippet, except instead of copying the contents verbatim, it can be used to pass the contents through the templating engine prior to including. This promotes reusability by having a common set of template text where we use boilerplate.

The primary use case is to refactor the provider code in the CIS compliance reference architecture so that we can reference variables like AwsRegion into a common snippet that is injected.

yorinasub17 commented 4 years ago

Woops that didn't work the way I intended...

To recover, undo-ing what gruntwork-ci did...

yorinasub17 commented 4 years ago

This has been force reverted

yorinasub17 commented 4 years ago

Reopend as https://github.com/gruntwork-io/boilerplate/pull/54