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
Adding timeout attribute the the schema forces resource replacement instead of in-place update #802
Comments
Hi @wojciechwroblewski 👋 Thank you for raising this and sorry you ran into trouble here. I'm not sure if there would be anything specific to Running with your example, we can see the following human readable plan:
Since the Typically using the Taking a step back though it might be helpful to understand more about your goals with this particular attribute and its expected behaviors. Is this intended to be a practitioner controlled "replace me" attribute, an API controlled "replace me" attribute, or a combination of the two? |
Thanks for quick reply. I could have found a better name for this attribute, but "replace me" attribute in my scenario is a value that can be set by the user, but may also be set by the API if left unconfigured. The API returns an empty string if the request did not contain a value for I'm trying to add a timeouts attribute to the resource, but also avoid the need to replace existing resources that are already deployed using the provider. If I understand that correctly, the timeouts are only stored in terraform state, so it should not be a problem to do the in-place update. My plan is to implement The AFAIK in provider-sdk-v2 the same scenario worked without the modifiers, the replace action was triggered only if there was a change in one of the attributes that were marked with |
Hi @wojciechwroblewski 👋 I apologize that I missed the question in your above reply, but it has also been quite a long time since this was discussed. Did you try anything out or do you need anything else here? |
Closing due to lack of response. |
Module version
Relevant provider source code
Slightly modified schema from
terraform-provider-scaffolding
, with an attribute configured to require replace if changed.Terraform Configuration Files
Initial configuration:
Updated config:
Debug Output
Expected Behavior
Adding a timeout section should trigger in-place upgrade
Actual Behavior
The resource was planned to be replaced
Steps to Reproduce
Code based on
terraform-provider-scaffolding
with test case demonstrating the behavior:wojciechwroblewski/terraform-provider-scaffolding-framework@6eeeb98
References
Not sure if the issue is exclusive to the timeouts block, just discovered that while implementing them.
Using
stringplanmodifier.RequiresReplaceIfConfigured()
instead ofRequiresReplace()
forreplace
attribute solves the issue, but I'd rather avoid it as it may result in configuration drift.The text was updated successfully, but these errors were encountered: