Hi, I wanted to get some feedback on 2 possible ways to define variables for a module.
Hopefully the description is clear.
Case 1 seems cleaner, or at least more properly defined? However, every module variable needs to be defined twice (in main and in module).
Case 2 has less definitions, and feels less bloated. I want to avoid though definitions that are hacky or not clean.
Same between both Cases
Module_A.variables.tf (var a1, var a2)
Module_B.variables.tf (var b1)
Case 1
main variables.tf (var a1, var a2, var b1).
main terraformv.tfars (a1=…, a2=…)
main.tf - Module_A.a1=var.a1. etc
Case 2
main variables.tf (locals{ a1=…, a2=…, b1=…}
main.tf - Module_A.a1=local.a1. etc
I’m very new to TF, so I’m open to hear different opinions, or downsides to either implementation.
Thanks!