When writing examples for my Terraform module, I got the error: "Module contains provider configuration" "Providers cannot be configured within modules using count, for_each or depends_on."
I got this error when I tried to add a depends_on block to the module's declaration to avoid trying to run the module plan before the creation of the resource group needed to deploy the resources inside the module.
If I don't add the depends_on block it also breaks, because it can't find the declared resource group that should be created before the module runs to populate the required resource group data source.
I find it is at least uncomfortable to require the removal of the providers block or to remove all the data sources.
I couldn't find any details on this error, or on how to fix it.
Specific line that raises this error inside Terraform's code.