Backport of Validate passing default providers through modules into v0.15 #28615
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #28606 to be assessed for backporting due to the inclusion of the label 0.15-backport.
The below text is copied from the body of the original PR.
Add validation for the local side of the providers map assignments in module calls. If these did not actually correspond to a configuration during runtime, the user would be presented with a
missing provider
error with the assumed address of the provider, but no indication how to configure that address. We can detect these during validation, and present a much more precise errorIt was also assumed that inherited providers could be referenced within modules, which is understandable because resources effectively do the same. This inheritance does not work in module calls however, because the provider is looked up in the next child module, one level removed from the inherited provider. Rather than re-work inheritance to account for this edge case, we can direct users to create a more explicit configuration by declaring the name within the module, so that we can follow up with the above recommendation if no configuration is presented.
Fixes #28565