-
Notifications
You must be signed in to change notification settings - Fork 1.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
Data sources with non-deterministic IDs show perpetual diff with Terraform 0.13 #7348
Data sources with non-deterministic IDs show perpetual diff with Terraform 0.13 #7348
Comments
I see id difference with 0.13.0, not with 0.12.18 |
We also see ID difference, e.g.
|
Drive-by comment: This problem can have a few causes -- while the data source difference will show the more obvious
We have experimentally seen in the AWS Provider that sometimes these non-obvious fixes can actually hide the unexpected difference output of a data source even without stabilizing the |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Summary
Data sources whose ID is set to a non-deterministic value (e.g. the current timestamp or a unique ID) that changes every time a refresh (the data source's Read method) runs show a perpetual diff starting with Terraform 0.13.0.
Issue #7092, and the related fix PR, show one possible way to fix data sources affected by this bug.
This has also been reported for the aws provider (hashicorp/terraform-provider-aws#14579) and other providers (see references below).
Comment posted by @jbardin in hashicorp/terraform#25805 (comment)
Comment posted by @bflad in hashicorp/terraform-provider-aws#14579 (comment)
Terraform Version
Terraform v0.13.3
Google Provider v2.20.3, and v3.39.0
Affected Resource(s)
To find the data sources affected, see this github repo search,
or run:
$ grep 'd.SetId' google/data_source*.go | grep Now
Terraform Configuration Files
Expected Behavior
TF v0.12 output from
terraform plan
(immediately after aterraform apply
):Actual Behavior
TF v0.13.3 output excerpt from
terraform plan
(immediately after aterraform apply
):Note that the value of the
id
attribute in the above output is different every time thatterraform plan
is executed.Steps to Reproduce
terraform apply
terraform plan > plan1.txt
terraform plan > plan2.txt
diff plan1.txt plan2.txt
Important Factoids
We use the output from
terraform plan
in our CI process. So if theterraform plan
output is not completely idempotent, then that is a big problem for us.References
data
resources? terraform#25805The text was updated successfully, but these errors were encountered: