Introduction
Sometimes your infrastructure code gets big and hard to manage. Creating a child module lets you split your code into smaller parts that you can reuse and organize better.
When you want to reuse the same infrastructure setup in different places without copying code.
When your main Terraform file is too long and you want to make it easier to read.
When you want to share infrastructure code with your team in a clean way.
When you want to separate different parts of your infrastructure logically.
When you want to test or update parts of your infrastructure independently.