-
Notifications
You must be signed in to change notification settings - Fork 217
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
Upgrade from Legacy Provider for use with count, for_each, depends_on #457
Comments
is there a solution? |
I just ran into this issue as well, but I don't think this provider is a "Legacy Provider" per se - the pattern of configuring a Provider within a Module is what is "legacy". Note the error message says "legacy module", not "legacy provider". Here's the relevant Terraform docs. |
Arguably the problem could be "fixed" in this provider by allowing us to configure the database connection parameters at the resource level instead of the provider level? |
@decoded4620 Is it a custom module or a public module? I think @rpaterson is right and the problem is that the
w00t 😅 ? that's the role of the I allow myself to close this issue but don't hesitate to reopen it if I'm missing something. |
I cannot speak for @decoded4620, but our issue is that we want to create a module for creating a database along with some tables and default configuration. The database itself is handled with another provider (azure, aws, etc.), but then we want to use this provider to connect and set up the database. So each module needs to connect to a different database, meaning the provider must be set up inside the module, otherwise there's no way to dynamically use the module. And we cannot use the provider inside the module because terraform does not allow this. So the only solution is to have the provider be the foundation without connection details and have a |
This is a problem in general with the provider being a "legacy provider". We had planned enabling management of multiple logical databases on a shared Postgres instance - and we wrapped this functionality up into a module to enable this across multiple tenants to be managed within a single terraform configuration.
We have these wrapped modules created using a
for_each
loop, and since each instance of the module references a shared RDS postgres instance, we run into the problem of the provider not being able to be instantiated - due to its legacy nature.The error is as follows:
Removing the postgresql provider from the module and passing it in would be required. But due to terraform alias restrictions this also is difficult to manage.
Will there be a plan to enable the provider:
To be able to be instantiated with different configurations within a module created from a loop?
This has created an interesting barrier for us - and we'll have to move the management of logical databases out of terraform.
If there is more information needed - I'll be happy to dig deeper and add it. But this issue seems like an overall module technical barrier - so keeping it high level for the moment.
Terraform Version
Terraform v1.8.3
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Sorry these are proprietary
Debug Output
Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
Panic Output
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the
crash.log
.Expected Behavior
What should have happened?
Actual Behavior
What actually happened?
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
The text was updated successfully, but these errors were encountered: