I’m still in the process of learning the ins and outs of terraform, and have a question regarding variables and modules.
In our infrastructure we have a variables.tf file in the root module. We have all our CIDR blocks defined among other things.
I was recently creating a module and found I had to copy some of the cidr’s that were defined in the root variables.tf file and add them to my modules variables.tf file before they would be recognized.
Is there a way for a module to “read in” the variables defined in the root module? I hate “re-defining” things, just seems like a lot of duplication. So how do I build a module and use variables that I would have defined in the root so I don’t have to keep defining them in every module I build?
Sorry if that is confusing, and equally sorry if it’s an obvious answer I’m just missing.