Hi, great help and thanks for this but the one I'm trying is puzzling me. The reusable module I want to make has a (Required) name - The name of the collector. I want to be able to give a new name each time but can't figure this out. I'm sure I'm missing something obvious here.
Great video again! So just to clarify the root module / child module explanation. If I have some terraform config in a folder eg main.tf that calls a module and passes some values over to it, is the folder that holds the main.tf the root or the child? The module code I am calling is what defines the actual resources but where I'm calling it from is where the tf init etc takes place.
The folder holding the main.tf is the root module. It's easier to think what directory you'll be executing Terraform from directly. If you're running Terraform directly against a configuration, that config is the root module for that run of Terraform.
@@NedintheCloud ok thanks. So regardless of whether I’m creating resources directly or calling another module, the code that does the calling is considered the root and any subsequent modules being called are the child?
@@p.a8750 Yes - this will be correct the hint will be if you are working from a .tf file and the content along the lines is calling a module like this source = "../../../../modules/services/service-plan" You are working in the Root module which is then calling the child module
I believe the precendent is that the root module will take effect ove the child module. But there should be no values set in the child module - those variables should be set to string