-
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
Handle semantically equivalent changes from the legacy SDK when planning data sources #25812
Comments
Further, this causes |
@jbardin I think I've found another case where this is still occurring in terraform 0.13.1. I am seeing a persistent diff when the data source references a "conditional" resource (e.g.
Run the apply once:
Then run it again:
|
In the repro, the persistent diff only happens when |
Hi @lorengordon, That example is unrelated to this PR. Please file a separate issue. Thanks! |
Oh ok, the symptom is the same in our case anyway. Thanks for following up @jbardin! |
Submitted #26100 |
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. |
The legacy SDK can cause changes to some empty containers types when the data source configuration is round-tripped through the ReadDataSource call. This can cause a planned data source configurations to appear to have changes when in fact they do not. These changes most manifest as empty container values being swapped for null container values.
These alone do not cause an issue, as the data source is usually read again transparently, and the planned value end up being identical. However, when this behavior is matched with data sources that do not have stable attributes, the combination will cause a new data source value to appear in each plan. This can bee seen with data sources like
data.aws_availability_zones
as referenced in hashicorp/terraform-provider-aws#14579.While these extra reads are usually benign, the plan output can get quite busy when there are a lot of data source being used in large configurations, as noted in #25805.
In order to mitigate this, we can possibly implement an imprecise comparison using heuristics specifically for data sources, so that extra reads are not performed when there are no semantically significant changes. Unfortunately we don't have an indication at that point when the data source was using the legacy SDK, so any changes here need to take into account that they will apply to any new SDK versions as well.
The text was updated successfully, but these errors were encountered: