How do inputs and outputs work with modules?

BeginnerConceptModules
Answer

Variables defined in the child are its inputs, passed as arguments in the module block. The child exposes values through output blocks; the parent reads them as module.<name>.<output>. A module cannot see the caller's variables or resources unless they are passed in.

All Terraform questions Roadmap: Terraform

More on Modules