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
stacks: handle unknown values in component for_each #35016
Conversation
967e996
to
cca4914
Compare
cca4914
to
c601fdf
Compare
c601fdf
to
c2663f8
Compare
4c31b00
to
b105e99
Compare
b105e99
to
7d648a1
Compare
7d648a1
to
9daebbe
Compare
b632e98
to
a3be97a
Compare
82b7d84
to
87f91ae
Compare
87f91ae
to
9dc07d1
Compare
9dc07d1
to
1a99da2
Compare
internal/stacks/stackruntime/internal/stackeval/component_instance.go
Outdated
Show resolved
Hide resolved
68fbe21
to
53938e7
Compare
Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
9b16d01
to
d224414
Compare
…stics So there is no need for checkValid to do this during th walkDynamicObjects phase
00de5cd
to
f847360
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I think I got a solid handle on the moving parts, and this feels good to me! I haven't done interactive testing of it, because as best as I can tell it's not quite enabled all the way through (such that I could load a stack into TFC and give it a drive). But the logic makes sense and the unit tests are convincing.
internal/stacks/stackruntime/internal/stackeval/component_test.go
Outdated
Show resolved
Hide resolved
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
In case we have an unknown
for_each
value in a component we create a component instance with theaddrs.WildcardKey
as the instance key to indicate that the "real" key is not yet known. We use appropriate unknown values for the repetition data so that the component itself can be planned as precise as possible. During the plan we tell terraform through the rpc api that this run in and of itself is deferred already.For reviewers unfamiliar with the stacks runtime: There is (afaik) no explicit graph being created, but it's implicitly generated through the call graph of e.g. looping through component instances. The promising library provides a model roughly similar to JS Promises to allow for an easier mental model for the concurrency involved.
Target Release
1.8.x
Draft CHANGELOG entry
NEW FEATURES