Skip to content
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

Walk expressions with expansion #340

Open
wata727 opened this issue Aug 3, 2024 · 0 comments
Open

Walk expressions with expansion #340

wata727 opened this issue Aug 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@wata727
Copy link
Member

wata727 commented Aug 3, 2024

See also terraform-linters/tflint-ruleset-terraform#199

The current WalkExpressions API cannot meet requirements such as terraform-linters/tflint-ruleset-terraform#199. This is because it is difficult to balance walking low-level expressions with values ​​being expanded at evaluation time. If we were to only look at the structure of the expression without evaluating it, walking the expression as many times as it was expanded would be redundant, but we would not be able to get all possible combinations of values ​​without doing so.

To solve this issue, we would need to introduce an API for each use case. For example, there is the WalkExpandedExpressions API, which expands expressions such as for expressions in advance and returns expressions with bound values.

This could be implemented as a host API, but more could also be implemented in the SDK by extending EvaluateExpr API to allow passing an arbitrary evaluation context.

@wata727 wata727 added the enhancement New feature or request label Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant