You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TFLint cannot statically evaluate dynamic values like aws_instance.test.id, so these values are ignored. Similarly, module outputs (e.g. module.aws_instance.id) are also marked as dynamic values.
However, module outputs are not always dynamic values. Modules that are used to share variables across multiple modules may have outputs that are statically determinable.
resource"aws_instance""test" {
tags=module.shared.tags# => This is a static value, but it cannot be evaluated by TFLint.
}
Proposal
Add support for evaluating static module outputs.
Currently, all module.* named values resolve to unknown values.
If call_module_type is other than none and the child module's sources are accessible, then the output of the child module that corresponds to the address reference will be evaluated when generating the evaluation context. This might be similar to evaluating local values.
If the value cannot be evaluated at any point, for example because the source of the grandchild module is inaccessible, an unknown value will be returned as before.
We are passing a module output containing a map of tags to the AWS provider default_tags and we want to use aws_provider_missing_default_tags rule to enforce this. Unfotunately, as the OP stated, any module output is ignored and the rule is not picking up the tags set by the module output.
Introduction
TFLint cannot statically evaluate dynamic values like
aws_instance.test.id
, so these values are ignored. Similarly, module outputs (e.g.module.aws_instance.id
) are also marked as dynamic values.However, module outputs are not always dynamic values. Modules that are used to share variables across multiple modules may have outputs that are statically determinable.
Proposal
Add support for evaluating static module outputs.
Currently, all
module.*
named values resolve to unknown values.tflint/terraform/lang/eval.go
Line 214 in a7179f0
If
call_module_type
is other thannone
and the child module's sources are accessible, then the output of the child module that corresponds to the address reference will be evaluated when generating the evaluation context. This might be similar to evaluating local values.tflint/terraform/evaluator.go
Lines 227 to 268 in a7179f0
If the value cannot be evaluated at any point, for example because the source of the grandchild module is inaccessible, an unknown value will be returned as before.
References
The text was updated successfully, but these errors were encountered: