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.
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
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
Man I was literally studying modules all morning lol thanks a bunch Ned.
Your explanations really hit home with networking people, must be your background!
Hands-on demo is better than a lecture
Thank you so much. I am working on modules and that helps alot. Greatly appreciate it, would help if you can present a demo on modules as well.
Awesome! Thank you!
Awesome!
good job bro
Thankyou
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.
if a value is already set in a child module and can it be overwritten by the values passed by root 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
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
Great
Neat
Start with the lessons first, adverts later
I don't always control where the adverts appear. Sorry!