terraform
terraform copied to clipboard
Finish implementation of unknown count/for_each in data sources
This PR adds tests for deferring data sources due to unknown count/for_each values, and makes the necessary behavior changes to get those tests passing.
For reviewers: here's the main things to validate about this PR.
- Is it logically and practically sound to always set
deferralAllowed = truein applies? If not, can we think of a safer way to re-process data sources that should be deferred (preferably without significantly changing the semantics of the plan)? - Does it make sense for
Deferred's informational methods to do early negative returns ifdeferralAllowed == false? - Can we think of any additional ways to directly or indirectly observe the effect of deferring a data source? I had a brief thought about spying on data source read requests in the mock provider, but in practice it turned out to be kinda awkward and not informative enough. More iteration might make something useful of it, tho. 🤔
Target Release
1.9.x
Draft CHANGELOG entry
EXPERIMENTS
The deferred actions experiment now supports deferring data sources due to unknown count/for_each values.