terraform module

Skip to first unread message


Jun 6, 2021, 10:58:51 AM6/6/21
to Terraform
Hi All

any code that is modularized from the re-usability point is called child module (example: ec2.tf). 
This child module can be used by any number of terraform code, by just having a module block and providing source of the child module

provider {...
module "calling_module"{
source = "./ec2.ff"

Confusion is, this calling configuration file is called root module, this is also called parent module, this is also called calling module? 

what exactly it is called?


Fernando 🐼

Jun 6, 2021, 11:28:52 AM6/6/21
to terrafo...@googlegroups.com
I've always seen it referred as root module. 
And it needs to be a folder, not a file like your example seems to indicate 

Fernando 🐼

In the coming weeks, inbound messages to this group will be disabled, and it will be used for outbound announcements only. To prepare for this switch, please direct questions and conversations to our primary medium to communicate with practitioners: https://discuss.hashicorp.com/c/terraform-core/27. We look forward to collaborating with you there!
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/2114b71e-aa32-47ca-b124-3b8b631a829an%40googlegroups.com.


Jun 6, 2021, 1:28:46 PM6/6/21
to Terraform
thanks Fernando, I got it now.
yes I have wrongly mentioned  source = "./ec2.ff", it should be  source = "./folder_of_child_module"

thanks you

Alexandra Freeman

Jun 21, 2021, 10:30:30 AM6/21/21
to Terraform
Hi Sandeep, thank you for your question; we are glad you were able to gather the answer and information you were looking for!
On June 3, 2019 HashiCorp launched Discuss, a forum to facilitate dialogue within the HashiCorp community. This format allows answers to be more readily searched and indexed, making it easier to find answers to existing questions and to share knowledge with each other. Please direct all questions and conversations to the discussion forum. We look forward to collaborating with you there!


Reply all
Reply to author
0 new messages