-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Make frontend backend_pool_settings computed #25912
Conversation
fixes #1421 by patching the upstream resource to be computed as the provider sets a value for it. This is needed for pulumi/pulumi-terraform-bridge#1936 works around hashicorp/terraform-provider-azurerm#25911 issue for patch: #2015 upstream PR: hashicorp/terraform-provider-azurerm#25912
Thanks for this PR @VenelinMartinov. We're moving away from the pattern of setting I believe you should be able to add |
Thanks for your response @stephybun. I imagine Can you help me understand why you'e made the change to move away from Computed for resources set by the API? Thank you for the link to the docs but it's not clear to me which use case is not possible if the property is marked Optional + Computed. Perhaps an example program would help? |
@VenelinMartinov sure I'll try and go into the specifics for this case. This particular instance of adding The reason being is that Terraform is unable to tell when a
This is the "side-effect" that's mentioned in the linked documentation. In other words I hope that clarifies things a bit better. Let me know if you still have questions. |
Thanks for the explanation @stephybun. If I understand correctly the issue is that, if the property is Computed, the provider can't know if the property in the old state was set by the user or by the API? If the property isn't Computed the provider always assumes the property is set by the user, even when it was actually set by the API. Could this be solved by utilising provider private state? https://developer.hashicorp.com/terraform/plugin/framework/resources/private-state Perhaps when a default value is applied, the provider can tag the field as being defaulted in the private state. Once that happens, on the next apply, if the user has removed the property in their input, the provider can look up if the value comes from a default in the private state, and if not, re-apply the default? This would solve both issues without any need for users to utilise ignore_changes in their programs. Have I understood the issue correctly and does this sound like something which might be feasible? |
@VenelinMartinov your understanding is correct. Without having looked into provider private state in great detail, it sounds like it could be a promising way to improve behaviours like this. Unfortunately private state is a framework feature and as mentioned in the docs that I linked, the provider currently exclusively uses We are working on adding support for For the moment the standard remains to add this property to |
Closing based on discussion above. When framework becomes available within the provider we can investigate alternative solutions. |
@stephybun many thanks for your explanations here 🙏 |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Community Note
Description
The provider sets a value for this property so it should be computed, otherwise the resource always produces a diff.
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
This is a (please select all that apply):
Related Issue(s)
Fixes #25911
Note
If this PR changes meaningfully during the course of review please update the title and description as required.