Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Modify passing-providers-explicitly section #35781 #35880

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions website/docs/language/modules/develop/providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ The keys of the `providers` map are provider configuration names as expected by
the child module, and the values are the names of corresponding configurations
in the _current_ module.

Once the `providers` argument is used in a `module` block, it overrides all of
the default inheritance behavior, so it is necessary to enumerate mappings
for _all_ of the required providers. This is to avoid confusion and surprises
that may result when mixing both implicit and explicit provider passing.
If the unaliased `provider` name is not present in the providers map,
it will still be inherited in the same way as implicit provider inheritance.
`providers` argument used in `module` block will not override the default
inheritance behavior.
Comment on lines +185 to +188
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the unaliased `provider` name is not present in the providers map,
it will still be inherited in the same way as implicit provider inheritance.
`providers` argument used in `module` block will not override the default
inheritance behavior.
Terraform implicitly passes the un-aliased provider name to child objects, even if it is excluded from the `providers` map. As a result, child objects still inherit the provider name according to the provider inheritance. Using the `providers` argument in a `module` block does not override the default inheritance behavior.

Is this clearer and still mean what you intended?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trujillo-adam, I'm not sure that clears things up (at least it doesn't for me, and I know how the implementation works)

Maybe just simplifying the original works better?

Once a provider's name is used in the providers argument within a module block, it overrides
the default inheritance behavior for that provider.

Or maybe just drop that paragraph altogether, since it's main purpose is to explain a behavior which doesn't exist. That was derived from old documentation which may not have ever been accurate as the implementation is the result of various compatibility compromises.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbardin removing that para won't help. User should be aware what happens for the provider block which doesn't have alias. Resources for unalias provider block still gets created same way even if we do not pass it explicitly in module hence I think what @trujillo-adam is clearer.


Additional provider configurations (those with the `alias` argument set) are
_never_ inherited automatically by child modules, and so must always be passed
Expand Down