-
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
Changing default value to nil for TypeInt in Optional parameter [ Custom Providers Development ] #90
Comments
At the moment the provider framework does not have any concept of "null", because Terraform itself doesn't either. However, work is in progress to address this via a new type system that's being introduced as part of the new version of the configuration language. It will, unfortunately, take a few steps before we reach the point where we can expose this capability to the provider framework (it has to be supported throughout Terraform Core first) but we are planning to do this, for the reason you stated. In the mean time, existing resources usually either use the zero value as an alias for "unset" or, when that isn't possible, make the attribute required and have the user set the default explicitly, or use some sort of "impossible value" as the default value, such as using |
Is the new type system still in the works? If not, it seems like there's a simple, if inelegant, fix for this problem. |
Yes, we are hard at work on the new type system. It's going to be the terraform 0.12 release, which you can read about in the terraform blog. |
An additional note on that, though: The Terraform 0.12 release will introduce the concept of "null" at the core level, but in order to preserve compatibility with older releases the provider SDK will not immediately get such support: for some time period, providers will need to work with both Terraform 0.12 and prior versions to allow for gradual upgrades. We do still intend to add support for null attributes at the SDK level, but this will be a separate change to the SDK itself (driven by our other team that maintains the SDK) that will come at a later point where new provider releases will no longer be compatible with Terraform versions earlier than 0.12. The exact schedule for that is not yet determined, since we want to wait and see how the upgrade process for 0.12 itself goes before imposing an effective deadline on it. |
0.12 looks pretty great: love the for loops and conditionals. Good to know that the new type system won't be immediately available to providers. |
Any news regarding this issue? |
We tried to use V2 SDK from branch "version2" today and run |
The best tracking issue will be #261. The v2 branch paves the way for us to start exposing this new functionality, but we will probably do it via new code paths to not break existing code. |
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. |
Hi,
Questions
Is there any way to set default value of
TypeInt
tonil
in optional parameters in Schema?Is there any way to find the value is provided by user or it is auto-set ?
Terraform Version
Terraform v0.10.8
Use Case
I am building custom terraform provider ,there I need to call api's through the configuration
Please suggest a way I can make it work ?
The text was updated successfully, but these errors were encountered: