terraform icon indicating copy to clipboard operation
terraform copied to clipboard

Finish implementation of unknown count/for_each in data sources

Open nfagerlund opened this issue 1 year ago • 0 comments

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 = true in 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 if deferralAllowed == 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.

nfagerlund avatar May 07 '24 02:05 nfagerlund