Open vikashkuma opened 2 months ago
Hi @vikashkuma, are you able to share the resource configuration for the resource that is changing? Based on the diff it looks like an employeeSchema
block is being removed and a new one added with a different email address rather than anything being set to null.
It's difficult for me to replicate this without knowing which resource you are using and the config of that resource.
Thanks!
@liamcervante I have updated the issue description with required details. Could you please take a look and let me know. Thanks
Hi @vikashkuma,
Symptoms like what you've described are more likely to be caused by the provider plugin than by Terraform Core, because it's ultimately the provider plugin that decides how to resolve any apparent differences between the desired state (from the configuration) and the prior state.
Therefore I expect that to reproduce this would require us to be able to use the same provider you are using. It seems like you are writing a new provider yourself, rather than using an existing provider.
Although I don't think we will be able to reproduce it directly without access to your full provider source code, we can probably get some clues as to what's going wrong if you run your second terraform plan
with the environment variable TF_LOG=trace
set, and then share the resulting verbose logs as a GitHub Gist. For providers using the legacy plugin SDK (which yours appears to be), Terraform Core often includes some additional notes in the trace log about apparent provider misbehavior which, if present in your log, will hopefully give us a clue as to what might be causing the strange behavior you observed here.
Terraform Version
Terraform Configuration Files
Debug Output
Expected Behavior
Terraform should detect no changes and confirm the infrastructure is up-to-date without setting any resource attributes to null.
To elaborate, when running terraform apply a second time without making any changes to the resources, Terraform should recognize that the current state matches the desired configuration as defined in the .tf files. It should not alter the existing resources or their attributes, and it should certainly not set any previously defined attributes (e.g., name = "John Doe") to null.
Actual Behavior
When running terraform apply a second time without making any changes to the Terraform configuration, the expected behavior is for Terraform to recognize that no changes are required and confirm that the infrastructure is already up-to-date. However, the actual behavior observed is that a specific resource attribute, name, is being unexpectedly set to null. This indicates a discrepancy between the Terraform state and the actual configuration or the infrastructure, resulting in unintended modifications to the resource state.
Steps to Reproduce
Additional Context
No response
References
github issue not yet created