Commit graph

22 commits

Author SHA1 Message Date
Radek Simko
0fe906fa8c make copyrightfix 2026-02-17 13:56:34 +00:00
James Bardin
807e084130 final renaming for function results 2025-05-08 11:42:05 -04:00
James Bardin
a6ec17cb77 rename function results table
Remove "provider" from the function results fields since it's not going
to be exclusively used for providers any longer.
2025-05-07 16:03:43 -04:00
James Bardin
d016070564 move function results hashing to lang
We need to abstract the function results verification to use internally
too, so start by moving it out of the providers code.
2025-05-07 13:02:46 -04:00
Liam Cervante
4eaa9d7fa0
stacks: removing embedded stacks should ignore stacks not in state (#36901) 2025-04-24 08:56:11 +02:00
Liam Cervante
063757ff45
stacks: refactor plan, state, and removed tracking with tree structures for efficient lookups (#36850) 2025-04-16 14:05:51 +02:00
Liam Cervante
a06f82746a
stacks: update removed blocks to allow targeting of embedded stacks (#36814)
* stacks: update removed blocks to allow targeting of embedded stacks

* copywrite headers
2025-04-04 15:01:37 +02: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
James Bardin
384f2d4fab update collections to use for-range method 2024-10-04 11:22:44 -04:00
Liam Cervante
b38fd17cf9
stacks: emit removal notices for empty components (#35738)
* stacks: emit removal notices for empty components

* fix tests and checks
2024-09-18 10:41:36 +02:00
Liam Cervante
d142486a40
stacks: expand plan and apply outputs for inputs (#35724) 2024-09-16 11:45:19 +02:00
Liam Cervante
73e3f8096b
stacks: complete stack output implementation for plan and apply (#35723) 2024-09-16 11:36:36 +02:00
Liam Cervante
6b2cc9c379
stacks: include existing instances for unknown removed and component blocks (#35691) 2024-09-10 08:59:04 +02:00
Liam Cervante
f1ae07b1af
stacks: add support for provider functions in .tfstack.hcl files (#35610)
* stacks: fix bug preventing cross-provider move refactorings

* also make provider functions work

* stacks: add support for provider functions in .tfstack.hcl files
2024-08-22 09:28:39 +02:00
Daniel Schmidt
b62a67394b
stacks: save plantimestamp to plan 2024-06-25 10:59:56 +02:00
Martin Atkins
e74896bd24 stackruntime: Handle apply-time-specified input variables
When the topmost stack configuration declares an ephemeral input variable,
its values must be provided separately for each of the plan and apply
phases.

Therefore here we extend the API to allow specifying input variable values
during the apply phase, and add rules to check whether all of the
apply-time-required input variables have been specified and whether any
non-ephemeral variables are either unspecified or re-specified with equal
values during the apply phase.

This also extends the FindStackConfigurationComponents response to include
more metadata about the input variables and output values so that a caller
can know which ones are ephemeral. The name of that RPC function had
already become a little too specific with the inclusion of embedded stack
information and is even moreso now; we might choose to rename it to
something more generic like "AnalyzeStackConfiguration" in future, but
that'd be a breaking change and therefore requires more coordination.
2024-06-17 08:34:46 -07:00
Liam Cervante
07f6621091
stacks: include resources in state when calculating required providers (#34645)
* stacks: include resources in state when calculating required providers

* also support apply time

* add copywrite headers
2024-02-15 10:45:47 +01:00
Martin Atkins
8fd29e9439 stacks: Preserve prior state from plan to apply
We need to retain the prior state (in a form that Terraform Core's modules
runtime can accept) between the plan and apply phases because Terraform
uses it to verify that the provider's "final plan" is consistent with
the initial plan.

We previously tried to do this by reusing the "old" value from the planned
change, but that's not really possible in practice because of the
historical implementation detail that Terraform wants state information
in a JSON format and plan information in MessagePack.

This also contains the beginnings of handling the "discarding" of
unrecognized keys from the state data structures, although we'll probably
need to do more in that area later since this is just the bare minimum.
2023-11-15 12:38:56 -08:00
Martin Atkins
c67920ce4b stackplan: Add HashiCorp copyright comments 2023-11-15 12:38:55 -08:00
Martin Atkins
d99985720f stacks: Carry input variable values from plan to apply
We need to preserve the input variable values provided during the plan
phase so we can reuse them during the apply phase to recalculate derived
results based on new information learned during the apply process.

We also need to recalculate the input values for individual components
during the apply phase, so we can react to previously-unknown values that
come from other upstream components.
2023-11-15 12:38:55 -08:00
Martin Atkins
ba8af34679 stackplan: Stub of runtime models for representing plans
This package includes both some model types to represent plans (and parts
thereof) in memory, and logic for translating between the in-memory
representation and our protocol-buffers-based storage serialization.

Unlike the traditional saved plan file format, the stacks model for
planning is slightly asymmetrical: while constructing the plan the system
will emit chunks of the overall plan piecemeal as PlannedChange values,
streamed to the rpcapi client. When reloading that plan to apply it,
the client must provide all of the raw plan blobs in sequence which we
can then decode one by one to construct a single Plan object covering the
entire effect of the plan.

Another intentional asymmetry is that PlannedChange includes enough
information to produce both the raw internal plan representation and the
public-facing plan description, whereas Plan only includes the subset of
information actually required for Terraform Core to apply the plan, from
the raw internal representation exclusively.
2023-11-15 12:38:52 -08:00
Martin Atkins
d857c75e33 stackplan: Initial models for a "meta-plan" over an entire stack 2023-11-15 12:38:51 -08:00