-
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
provider/variable sharing in modules #18406
Comments
Hi @a14m! In Terraform 0.11 we refined the ways in which providers pass between modules to better support this situation. As of that release, we recommend that most users put In your case then, the At present this pattern will hit the limitation discussed in #16835, preventing those child modules from declaring which version of the # (not yet implemented and details may change before release)
terraform {
required_providers = {
aws = "~> 1.26"
}
} There is more information on this in the Providers within Modules section of the documentation, including an optional syntax for explicitly passing providers into child modules for situations where the default inheritance behavior is insufficient. I believe that this (except for the forthcoming change discussed in #16835) covers your use-case. Please let me know if I missed something! |
Thanks a lot... this covers the use-case of provider configuration... adding those issues here for future reference:
|
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. |
not to convolute the repo with a similar question... but is there a way of abstracting the provider for all the modules defined in a project.
for example, I have this project
and it works fine...
the problem is with the definition of modules
the provider in both of these modules are exactly the same
and the variables in each module are different but they all have the
region
variable.is there a way to define those bits of information on the modules level
so that I end up with something roughly like this
Thanks in advance.
The text was updated successfully, but these errors were encountered: