Skip to content
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

Merged
merged 11 commits into from May 2, 2024
Merged

Conversation

DanielMSchmidt
Copy link
Collaborator

@DanielMSchmidt DanielMSchmidt commented Apr 17, 2024

In case we have an unknown for_each value in a component we create a component instance with the addrs.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

  • stacks: handle unknown values in component for_each

Copy link
Collaborator

@nfagerlund nfagerlund left a 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.

@DanielMSchmidt DanielMSchmidt merged commit 5af49eb into main May 2, 2024
10 checks passed
Copy link

github-actions bot commented May 2, 2024

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants