Skill 5.3.2
Module composition and meta-arguments
Key Concepts
Module composition means building infrastructure from small, focused modules wired together in the root module: the network module's outputs feed the database and application modules' inputs. HashiCorp recommends keeping the module tree flat, with the root module doing the wiring, rather than nesting modules many levels deep.
count and for_each on a module block create several instances of the whole module, addressed as module.app["eu"]. providers passes provider configurations, and depends_on makes the whole module wait for other objects. Modules should not contain provider blocks of their own if they are to be used with count, for_each or depends_on.