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

handling module inputs from other module outputs #185

Closed
kapilt opened this issue Mar 6, 2024 · 0 comments · Fixed by #188
Closed

handling module inputs from other module outputs #185

kapilt opened this issue Mar 6, 2024 · 0 comments · Fixed by #188

Comments

@kapilt
Copy link
Contributor

kapilt commented Mar 6, 2024

tfparse doesn't seem to handle passing outputs from module A as an input to module B.

the evaluation of the input within module B seems to only handle values known at module's B evaluation time.

This is due to behavior in the underlying golang library. Separately that golang library has been refactored
recently into a separate package (defsec -> trivy-iac). The current source for that evaluation is

https://github.com/aquasecurity/trivy-iac/blob/v0.7.1/pkg/scanners/terraform/parser/evaluator.go#L121

the location/version used by tfparse is defsec @ 0.90.1
https://github.com/aquasecurity/defsec/blob/988b9e9444c616a573dbbb670e65a05253e3ab2d/pkg/scanners/terraform/parser/evaluator.go#L118

wrt to resolution, it could be a question of fixing evaluateStep to consider module input changes. I think we need to validate
as well that the input variable outside the module is the same identity as the input variable inside the module, ie. there is a
common linkage for when the variable outside the module is resolved.

at the moment looking at the structure generated by tfparse

/root
  - mod-a output -> correct
  - mod-b input var -> correct
  /mod-b
      - input var -> unknown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant