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

Conversation

yogi345
Copy link

@yogi345 yogi345 commented Oct 20, 2024

This is a doc issue so updated the affected documentation page terraform\website\docs\language\modules\develop\providers.mdx

1.10.x

References

Copy link

hashicorp-cla-app bot commented Oct 20, 2024

CLA assistant check
All committers have signed the CLA.

@yogi345
Copy link
Author

yogi345 commented Oct 20, 2024

Code-with-default-aliased-provider
image

Attaching Tested code behavior

@yogi345 yogi345 changed the title docs: Modify passing-providers-explicitly section #35781 docs: Modify passing-providers-explicitly section #35781 #documentation Oct 21, 2024
@yogi345 yogi345 changed the title docs: Modify passing-providers-explicitly section #35781 #documentation docs: Modify passing-providers-explicitly section #35781 Oct 21, 2024
Copy link
Contributor

@trujillo-adam trujillo-adam left a comment

Choose a reason for hiding this comment

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

Tried a little rewording to see if we could make this clearer.

Comment on lines +185 to +188
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.
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.

@yogi345
Copy link
Author

yogi345 commented Nov 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants