-
Notifications
You must be signed in to change notification settings - Fork 232
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
Better unknown value handling in Configure or PrepareProviderConfig #331
Comments
Related to #261 |
There is some background discussion on this in hashicorp/terraform#24164, including a real example of an existing provider ( |
Additionally, I have the case where my |
With the release of terraform-plugin-go, this is now supported through that library. It is not supported through helper/schema yet, and I don't know that it ever will be, or even could be. Given that, I'm going to close this issue out, but people should feel free to comment here if this solution is unworkable for some reason. |
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 core allows providers to be configured referencing values that won't be known until apply, since in some cases providers don't need a complete configuration to create a plan. This provides some utility for providers expecting it, but the current SDK does not expose that a value is unknown, so defaults are often applied instead. This usually results in confusing errors from the provider, or even the provider being used with the incorrect configuration.
The SDK could assist in the validation of unknown config values. The current protocol provides 2 calls that both may need to handle this situation:
PrepareProviderConfig
is where the configuration defaults are inserted and the entire config is validated (akin to a "plan" for provider configuration). Unknown values currently pass throughPrepareProviderConfig
untouched.Configure
is where the configuration is applied to the provider, and this is where the "unknown" status of configuration values is lost.The text was updated successfully, but these errors were encountered: