-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Data sources with non-deterministic IDs show perpetual diff with Terraform 0.13.3 #26316
Comments
Hi @srishtipmishra, Thanks for filing the issue. Would it be possible to supply a stand-alone reproduction case for one of these data sets? What is likely happening is that there is an apparent change in the data source configuration, triggering it to be read again. The data source then returns the original data, except for the ID field which shows up as an update. This means the issue could be that the data source fields are inconsistent with the config, or an input to the data source is inconsistent, but the changing ID is not the problem. There may also be some |
Hi @jbardin - The zip is larger than 10MB. Is there a better way of sharing it? Fyi, the root cause is known here. Our datasource ID is a non-static one (timestamp). So, every time a read happens new value is set in SetData() which is causing the diff. We also tried changing it to a static value on provider's side and the diff goes away. However, this is hitting backward compatibility for us since issue appears only in TF13. Let me know if you need any other data my end. |
I don't think the full logs will help in this case, the warning messages are about all that's useful for this situation. The non-static ID is not the root cause here; ID isn't a special field for Terraform at all, and it would be just as valid for any other field to change on every read and produce the same result. Removing unnecessary changes from the data source will of course help the situation, but the source of the problem is that there appears to be a change in the configuration causing the data source to be read again. If there is no apparent change in configuration during plan, then the data source is not read again, and there is no chance for a new ID to show up as a change. This will all hopefully be a non-issue in the upcoming 0.14 release, which will eliminate the separate Refresh phase when creating a plan. Once that's in place, we should only have to read a data source once in a plan+apply cycle, and won't see any updates that should have been transparent to the user. |
Hi, all |
Since there isn't any more we can do here from the core side, I'm going to close this out for now. |
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. |
Terraform Version
Terraform Configuration Files
Debug Output
Full debug output can be obtained by running Terraform with the environment variable
TF_LOG=trace
. Please create a GitHub Gist containing the debug output. Please do not paste the debug output in the issue, since debug output is long.Debug output may contain sensitive information. Please review it before posting publicly, and if you are concerned feel free to encrypt the files using the HashiCorp security public key.
Terraform will perform the following actions:
Crash Output
Expected Behavior
No diffs expected on
terraform plan
Actual Behavior
Datasource ids show a diff on plan after successful apply
Steps to Reproduce
Please list the full steps required to reproduce the issue, for example:
terraform init
terraform apply
terraform plan
Additional Context
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
The text was updated successfully, but these errors were encountered: