What limitations do `for_each` modules have with providers?
AdvancedConceptModules
Answer
A module call using for_each cannot also define the provider inside that module, and removing a key whose provider config lived inside the module leaves Terraform unable to destroy it ("Provider configuration not present"). Keep provider configuration in the root and pass it in, and destroy resources before removing their provider.
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?IntermediateCan you use `count` and `for_each` on modules?Intermediate