Can you use `count` and `for_each` on modules?
IntermediateConceptModules
Answer
Yes, since Terraform 0.13 for modules, giving module.app[0] or module.app["blue"]. It lets you stamp out an environment per key. Watch out: removing a key destroys everything inside that module instance, and modules that define their own provider blocks cannot be used with count/for_each.
More on Modules
What is a Terraform module and why use one?BeginnerHow do you call a module?BeginnerHow do inputs and outputs work with modules?BeginnerWhich module source types exist and where does `version` apply?IntermediateHow should you version and pin modules?IntermediateHow do providers get passed to a module?Advanced