-
Notifications
You must be signed in to change notification settings - Fork 44
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
No diff shown when a computed + optional property is removed #2152
Comments
We need a very high threshold for willingly diverge from TF behavior because community providers are designed with TF behavior in mind and gravitate to that. Why diverge? |
This is a major shortcoming of the SDKv2 - it is the reason why the tf-azure provider has a policy AGAINST using Computed even for properties set by the cloud. It is also very unintuitive behaviour. It'd be useful to at least consider how this interacts with the provider code. |
Perhaps an option that a provider author can opt into? But even then, what are the concrete use cases this would target fixing?
So it sounds like tf-azure is not affected, what is affected? This comment you linked is a good reference but doesn't quite explain the rationale.
Looks like hashicorp/terraform-plugin-sdk#1101 can be another reference. Looks like upstream stance is to migrate to Plugin Framework. |
Tangentially, the rationale for this may have something to do with __defaults mechanism in the V3 Bridge. There is uncertainty for some values whether they were introduced by the user or the provider, what's the origin of the value. Looks like this SDKv2 behavior may be assuming that an Optional+Computed value was written to the state by the provider (as Computed), and therefore should not be removed even if it is omitted from the program. A side channel like __defaults was used to try to track who wrote the value. We opted not to do it in PF leading to similar issues with unexpected non-removals. I remain slightly skeptical we can force a good design here. |
What happened?
Due to https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/data-consistency-errors#planned-value-for-a-non-computed-attribute the plugin SDK always keeps the state value for a Computed + Optional property which was removed.
We might want to consider a bridge fix. This will diverge from TF behaviour but this behaviour is pretty bad.
Example
pulumi/pulumi-azure#1881
Output of
pulumi about
.
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: