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.

All Terraform questions Roadmap: Terraform

More on Modules