-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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 can be configured with unknown values #24131
Comments
Hi @hazcod, Thanks for filing the issue. The problem here is that you are attempting to configure a provider using computed values from resources not yet created. A provider cannot refer to anything unknown before it's configured, (see Provider Configuration), and the kubernetes provider in your configuration is being configured using the values from So the configuration you have is passing the data as expected, and using those values with resources would work as expected, but the provider itself is ignoring the unknown values. This should be better validated during plan, so that providers aren't accidentally configured with incorrect values. |
Thanks for confirming @jbardin , this was slowly driving me mad. :-) |
@jbardin : just to be sure, is the problem here that |
@hazcod, This cannot work if the provider needs to use that configuration during plan or refresh which is often the case. The linked PR would only serve to make this fail more quickly with an error directly referring to the unknown values in the config, rather than risking the provider being configured incorrectly. Unfortunately it's been pointed out that some providers rely on this behavior, and it can be useful in a few cases. We still need more safety here, but that is better handled by the provider SDK than in core. |
Closing this is preference for hashicorp/terraform-plugin-sdk#331 |
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. |
1 similar comment
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. |
Terraform Version
Latest
Terraform Configuration Files
https://github.com/ironPeakServices/infrastructure/tree/debug/submodulevars
Debug Output
https://github.com/ironPeakServices/infrastructure/pull/19/checks?check_run_id=450132650#step:9:655
Expected Behavior
Submodules using the specified variables.
In my case, I pass my submodule arguments via the submodule variables.
Actual Behavior
Kubernetes (or any other) provider is not using the passed variables.
A workaround is needed by specifying the provider variables in the root module (here commented for the sake of this issue): https://github.com/ironPeakServices/infrastructure/blob/debug/submodulevars/versions.tf#L7
Steps to Reproduce
terraform plan .
Additional Context
Possibly related/causing hashicorp/terraform-provider-kubernetes#708
References
hashicorp/terraform-provider-kubernetes#708
The text was updated successfully, but these errors were encountered: