Commit graph

10 commits

Author SHA1 Message Date
Radek Simko
0fe906fa8c make copyrightfix 2026-02-17 13:56:34 +00:00
Liam Cervante
2b5101f734
stacks: include existing components when deferring nested stacks (#36788)
* stacks: include existing components when deferring nested stacks

* improve comments
2025-04-03 10:40:28 +02:00
Martin Atkins
434e199675 stackaddrs: Add HashiCorp copyright comments 2023-11-15 12:38:55 -08:00
Martin Atkins
f347d0a441 stackaddrs: Handle instance keys in embedded stack references
Previously this logic was wrong, because it had already consumed the two
leading traversal steps before checking if there was anything else.
2023-11-15 12:38:55 -08:00
Martin Atkins
385e37cae2 stackaddrs: fix some ParseAbsComponentInstance logic errors 2023-11-15 12:38:55 -08:00
Martin Atkins
ebab67b468 stackaddrs: AbsComponentInstance address parsing
Addresses of this type will appear in some of our serialization formats
and so we need a parser function which provides the inverse of the
"String" method of this type.
2023-11-15 12:38:51 -08:00
Martin Atkins
e0797ab913 stackaddrs: Addresses for things inside components
In the stacks model a component is essentially a container for a tree of
normal Terraform modules, and so anything that can appear in a Terraform
module can in principle appear inside a component.

With that in mind here we define a generic type that can represent
anything from package addrs belonging either to a stack configuration
(before instance expansion) or to a stack instance (after instance
expansion), and some aliases for a few combinations that make sense
together, such as stackaddrs.AbsResourceInstance being an
addrs.AbsResourceInstance belonging to a stackaddrs.AbsComponentInstance.

We'll probably add more aliases here later, but this is a starting set
that I expect will arise while implementing the planning-related models
for stacks.
2023-11-15 12:38:51 -08:00
Martin Atkins
59a044dd6f stackeval: The naming of promises
If a stack configuration has a dependency cycle we'll tend to detect it
by the promises failing to resolve due to a self-reference. Describing
that situation to end-users has been historically hard in existing
Terraform's dag-based implementation, and there are some similar
challenges for this promise-based design too.

To deal with it while minimizing runtime overhead in the happy path we'll
teach the various objects to retroactively report names for the promises
they've already instantiated and then only when we encounter the
ErrSelfDependent error will we walk the tree of objects to find
user-friendly names for all of the promises that have contributed to the
results so far.
2023-11-15 12:38:51 -08:00
Martin Atkins
3d503f8e71 stackruntime: Stubbing the "interpreter" for stack configurations 2023-11-15 12:38:51 -08:00
Martin Atkins
e667352553 stacks/stackaddrs: Initial address types for stacks
This serves a similar purpose to the "addrs" package for Terraform overall,
but deals with concepts that are unique to the stacks language.
2023-11-15 12:38:50 -08:00