-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Providers are not inherited by grandchildren #4865
Comments
Any word on this? This has stung me too recently. |
@phinze running into this today, trying to adapt some scripts from https://github.com/hashicorp/best-practices/tree/master/terraform. Somehow, on the first run it worked fine, but then I must have changed something, and now it's completely ignoring the |
@Bowbaq I was just reviewing issues today and this made it onto a short list to look into - you can work around it by switching to environment variable based config, but I agree it's annoying. Will see if I can get this sorted out before the 0.6.13 release. 👍 |
@phinze any updates on this? |
Sorry I haven't been able to get to this yet - just noting that this is still on my (ever-shuffling) stack! 👌 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
When you declare a provider and then import a module, the child module has access to the provider declared in the parent. If the imported child module in turn imports a module the grandchild module does not have access to the provider declared in the grandparent.
terraform-bug-repro.zip
In the reproduction sample provided there is a root TF file, and 3 modules. The root calls module 1, which calls module 2, which calls module 3, all 3 modules instantiate a resource. In order for this to execute without error a provider must be declared in the root and module 2. Module 1 inherits its provider from the root, and module 3 inherits its provider from module 2. If the provider is left out of module 2 it will attempt to instantiate a new provider rather than use the one that module one has inherited from the root.
The following issues appear to be relevant to this issue:
#3285
#1819
The text was updated successfully, but these errors were encountered: