Commit graph

63 commits

Author SHA1 Message Date
Daniel Schmidt
bc901abcc5 stacks: test resource identity 2025-03-12 14:46:50 +01:00
Liam Cervante
3d014d82f3
stacks: fix errors processing index keys of removed blocks (#36673) 2025-03-12 10:33:18 +01:00
Liam Cervante
1c04516392
stacks: allow unknown variables during apply operations (#36311) 2025-01-20 12:18:35 +01:00
Liam Cervante
a5c9903bbe
deferred actions: don't plan partial resources during refresh and destroy (#36310)
* deferred actions: don't plan partial resources during refresh and destroy

* actually, imports don't trigger during refresh

* Update internal/terraform/node_resource_plan_partialexp.go

Co-authored-by: Nick Fagerlund <nick.fagerlund@gmail.com>

* address comments

---------

Co-authored-by: Nick Fagerlund <nick.fagerlund@gmail.com>
2025-01-20 12:18:25 +01:00
Liam Cervante
a384d2daa7
stacks: fix deferred data sources and unknown component applies (#35876) 2024-10-22 11:23:53 +02:00
Liam Cervante
7eb94fa7c8 stacks: fix tests broken now that ephemeral outputs aren't allowed 2024-10-11 10:23:10 +02:00
Liam Cervante
669e8ff1a6
stacks: skip full plan/apply cycles when deleting empty state (#35831) 2024-10-09 16:32:54 +02:00
Liam Cervante
bfa320c7b0
stacks: represent ephemeral inputs and outputs as null (#35824)
* stacks: represent ephemeral inputs and outputs as null

* quick fix: remove unnecessary check
2024-10-08 16:46:31 +02:00
Liam Cervante
d93e18d155
stacks: separate refresh and destroy stages during destroy plans (#35744)
* add tests that highlight known issues in the destroy mechanism

* separate refresh during destroy plans

* use the refresh outputs during destroy plans

* copywrite headers
2024-09-19 11:36:41 +02:00
Daniel Schmidt
e50a1ac824
stacks: fix dependency handling in component forget 2024-09-17 14:15:43 +02:00
Liam Cervante
73e3f8096b
stacks: complete stack output implementation for plan and apply (#35723) 2024-09-16 11:36:36 +02:00
Daniel Schmidt
ceb52e65bb
stacks: support forgetting components 2024-09-16 10:20:29 +02:00
Liam Cervante
c00bee8bbd
stacks: add a test for removed blocks in embedded stacks (#35681)
* stacks: add a test for removed blocks in embedded stacks

* restore test files
2024-09-07 15:22:59 +02:00
Liam Cervante
cf49545b5a
stacks: include removed blocks during validate command (#35680) 2024-09-07 15:04:14 +02:00
Liam Cervante
f8fe397d88
stacks: add removed block functionality (#35671)
* stacks: add removed block functionality

* fix compile errors
2024-09-07 14:36:16 +02:00
Liam Cervante
7163c4b6d5
stacks: fix destroy ordering of stacks destroy plans (#35665)
* stacks: remove unneeded required components functions

* stacks: refactor the mock provider for realism

* deferred actions: fix missing features in deletions

* stacks: fix destroy ordering of stacks destroy plans

* fix missing import
2024-09-05 12:10:24 +02:00
Liam Cervante
cb7bae3217
stacks: remove stale state during Stack apply operations (#35639) 2024-08-28 09:23:41 +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
Liam Cervante
964c64157c
stacks: fix bug preventing unconfigured clients within Terraform (#35571)
* stacks: fix bug preventing cross-provider move refactorings

* also make provider functions work
2024-08-22 09:20:47 +02:00
Liam Cervante
047c1af0b4
stacks: add tests for state manipulation failure cases (#35589) 2024-08-19 11:45:08 +02:00
Liam Cervante
5939efb798
stacks: add depends_on for embedded stacks and components (#35549) 2024-08-12 15:02:36 +02:00
Liam Cervante
46393f2a92
stacks: apply automatic type conversion before comparing inputs (#35530)
* stacks: apply automatic type conversion before comparing inputs

* correct error message for missing ephemeral value during apply
2024-08-05 10:08:35 +02:00
Liam Cervante
33c0ae7f09
stacks: add additional provider validation tests (#35471) 2024-07-26 11:36:08 +02:00
Liam Cervante
87bbc47737
stacks: include plan mode in stacks plan format (#35405)
* stacks: include plan mode in stacks plan format

* fix tests

* fix missed files
2024-07-23 17:45:07 +02:00
Liam Cervante
3ecf7655ba
stacks: insert unknown values for missing outputs during applies (#35463)
* stacks: insert unknown values for missing outputs during apply operations

* fix tests
2024-07-17 08:44:39 +02:00
Daniel Schmidt
1d45d12f40
stacks: track resource deferrals in apply 2024-07-11 16:33:36 +02:00
Liam Cervante
8e47b5907c
stacks: provide more helpful diagnostics when providers types are mismatched (#35422)
* stacks: provide more helpful diagnostics when providers types are mismatched

* remove left over implementation experiments

* remove unnecessary fmt.Sprintf

* address comments

* fix incorrect pluralisation

* fix tests
2024-07-08 10:31:52 +02:00
Daniel Schmidt
b62a67394b
stacks: save plantimestamp to plan 2024-06-25 10:59:56 +02:00
Daniel Schmidt
8fa922f912
stacks: implement PlanTimestamp method on ExpressionScope
This allows us to set the plantimestamp methods value in
the stacks language
2024-06-24 17:19:18 +02:00
Liam Cervante
c0499647fa
stacks: include moved and removed in API (#35360)
* stacks: include moved and removed in API

* fix race test
2024-06-20 11:04:22 +02:00
Liam Cervante
b646dff26a
stacks: apply nested default values to inputs (#35349)
* stacks: apply nested default values to inputs

* group similar tests
2024-06-18 12:03:43 +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
fc390038f3
stacks: add tests for and refactor steps when a provider can't be configured (#35294) 2024-06-06 13:36:57 +02:00
Liam Cervante
dc06717f69
stacks: add support for unknown for_each expressions in providers (#35267)
* stacks: add support for unknown for_each expressions in providers

* return more precise values for the unknown provider
2024-06-04 16:26:23 +02:00
Liam Cervante
1e9a186059
stacks: return dynamic types when referencing partial components (#35254) 2024-06-04 15:32:50 +02:00
Daniel Schmidt
59ead5356f
stacks: update RPC APIs with deferral information (#35125)
* stacks: add deferred resource instance planned change to protobuf

* stacks: add deferred resource instance to stack plan sequence

* stacks: add planned change for deferred actions

* stacks: refactor planned change resource instance planned

moving the components out of the main function definition so that we can reuse the implementation for deferred resource instances which wraps the message used for PlannedChangeResourceInstancePlanned

* stacks: track deferred changes in stackplan

* add simple tests

* fix tests

* address comments

---------

Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
2024-06-04 15:14:00 +02:00
Liam Cervante
7a8ffff66e
stacks: Fix unknown provider values crashing validation phase (#35155)
* test to reproduce

* stacks: Fix unknown provider values crashing validation phase

* remove extra type information

---------

Co-authored-by: CJ Horton <cjhorton@hashicorp.com>
2024-05-16 13:06:13 +02:00
Daniel Schmidt
3267718d3d
stacks: support unknown for_each on embedded stacks 2024-05-06 16:50:48 +02:00
kmoe
b74715e5fb
stacks: fix invalid filename (#35111) 2024-05-03 08:12:27 +01:00
Daniel Schmidt
aeb5b47723
stacks: remove unused test case 2024-04-30 17:16:49 +02:00
Daniel Schmidt
3cbfd39721
stacks: validate unknown component for_each type 2024-04-29 16:31:20 +02:00
Daniel Schmidt
3a7150b27e
stacks: handle unknown values in component for_each 2024-04-29 16:31:20 +02:00
Alisdair McDiarmid
f409639934
Merge pull request #34765 from hashicorp/alisdair/stack-root-input-variable-defaults
stackruntime: Apply defaults to root variables
2024-03-08 11:09:21 -05:00
Alisdair McDiarmid
f3ec86b17b stackruntime: Treat unset and null equally
When handling root input variable values, we now consider unset and null
values to be equivalent to each other. This is consistent with how we
handle variables in embedded stacks, and very similar to how we handle
variable in the modules runtime with `nullable = false`.

One difference from the modules runtime case is that we do not prevent
a null default value for stack variables.
2024-03-07 15:49:39 -05:00
Alisdair McDiarmid
0fe26468cd stackruntime: Apply defaults to root variables
When evaluating a stack's root input variables, supplied by the caller,
we must apply any default values specified in the variable
configuration for variables with no specified value. This commit adds
this default fallback case, using NilVal as a marker indicating the lack
of a specified value.

If no default value exists for a variable, it is therefore required to
be supplied by the caller. This commit also reports a diagnostic error
in this case.
2024-03-04 16:20:17 -05:00
CJ Horton
5a750561e6 round-trip check results through stack plans
Components expect that check results will be round-tripped
through the plan in order to update unknown check results
during the apply. We hadn't wired this up for stack plans,
resulting in panics when the apply tries to update a check
status that doesn't exist.
2024-03-01 17:22:44 -08:00
Liam Cervante
cec4b7b74c
stacks: validate providers based on types instead of local names (#34735)
* stacks: validate providers based on types instead of local names

* fix tests
2024-02-28 08:24:53 +01:00
Liam Cervante
31a7fa88d5
stacks: validate provider configurations during static analysis (#34730) 2024-02-27 08:43:58 +01:00
Liam Cervante
b2cc7dbadf
stacks: validate the types of input variables during validation (#34722) 2024-02-26 11:36:19 +01:00
Liam Cervante
b3abff5750
stacks: check providers blocks in components during validatation (#34707) 2024-02-21 11:07:51 +01:00