The old implementation of recursively rendering the variables breaks a valid use case where you want to render a config file that relies on Go template syntax (e.g., Github Actions), as boilerplate will always try to render the nested template that we don't want rendered. This old implementation existed because we wanted to support nested variable lookups in the variable values.
To address this, I updated the variable rendering logic to use an approach similar to what we do in terragrunt with locals:
Instead of recursively evaluating the template until we can't anymore, we do rendering trials where we do single pass rendering attempts until there is no more errors, or no new variables are rendered.
This new approach should handle both use cases where we have multiple, nested variable references and the case where we want to output Go template syntax in a boilerplate variable value.
TODOs
Please ensure all of these TODOs are completed before asking for a review.
[x] Ensure the branch is named correctly with the issue number. e.g: feature/new-vpc-endpoints-955 or bug/missing-count-param-434.
[x] Update the docs.
[x] Keep the changes backward compatible where possible.
Description
Fix https://github.com/gruntwork-io/boilerplate/issues/89
The old implementation of recursively rendering the variables breaks a valid use case where you want to render a config file that relies on Go template syntax (e.g., Github Actions), as
boilerplate
will always try to render the nested template that we don't want rendered. This old implementation existed because we wanted to support nested variable lookups in the variable values.To address this, I updated the variable rendering logic to use an approach similar to what we do in
terragrunt
withlocals
:This new approach should handle both use cases where we have multiple, nested variable references and the case where we want to output Go template syntax in a boilerplate variable value.
TODOs
Please ensure all of these TODOs are completed before asking for a review.
feature/new-vpc-endpoints-955
orbug/missing-count-param-434
.