Closed kerscher closed 5 years ago
I would prefer to have a tool that warns us when a mistake has been made, over classifying all use of inlines as evil. I believe we should review occurrences of this individually, and I'm not sure how I feel about a single issue to encompass of occurrences of this pattern.
There is nothing inherently evil in this, just as there is nothing evil in pointer arithmetic in C. But designing a tool that checks when either is correct is a very large challenge. It’s just a set of tradeoffs. I will remove the checks from #103 until we do a manual review then.
We can add the review for the items above in this issue here until all occurrences have been documented as OK or not, since it has to be tracked somewhere and this has the list already. Then we close it. Sounds good?
Inline values prevent templates from being checked as individual files externally, but this is only a nuisance. The real danger is that forgetting to close an inline delimiter changes semantics of the entire
.tf
file. Check the example below:The following code above will
terraform apply
correctly, butmodule.a.param
will not bebar
, andmodule.b
will never be created. In modules with nested resources or a large amount of modules this can easily pass unnoticed — specially common sincemodule
s take nocount
.A counter-argument is that syntax highlight could potentially showcase this problem. But this cannot be checked without human intervention, as a checker cannot know if
module.b
should or not be created.The following modules are currently using inline values and should be changed to use templates with external files instead: