-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hclsyntax: Template expression produces too large value refinements #616
Comments
Hi @wata727! Thanks for reporting this. I think for the moment it's probably most pragmatic to just set a reasonable upper limit in HCL's template implementation where after a certain size it truncates the known prefix. That should still produce a valid refinement because it will broaden rather than tighten the range of the result. The question of whether and how to have limits in |
Oh and on the subject of removing refinements: today we have some code in Terraform doing that to work around some historical implementation mistakes in Terraform's rules for validating plans and we're doing it by using That could potentially be a helper function in |
Thank you for answering my question.
Agreed. I've opened a PR for this issue #617
Thank you for telling me how to do this. The |
See #590
See zclconf/go-cty#153
HCL v2.17 introduced value refinements. However, this can result in template expressions that produce too large refinements.
There are two issues with too large refinements. One, as shown above, is hitting the upper limit of go-cty's MessagePack serialization. The other is that it can be nonsense for user feedback purposes.
Such issues mainly occur in Terraform's
templatefile
function. Imagine an example with an unknown value at the end of a huge JSON file. terraform-linters/tflint#1791 is an actual reported issue in TFLint.To be honest, I struggled with whether to report this issue to HCL or go-cty. I believe the solutions to this issue are:
value.WithoutRefinements
.The text was updated successfully, but these errors were encountered: