Commit graph

31 commits

Author SHA1 Message Date
Mutahhir Hayat
1c9c8d473e Remove unnecessary prefix 2026-03-06 15:54:23 +01:00
Mutahhir Hayat
ffeff0914d Support for deferred action invocations in plan
We encovered that deferred action invocations don't get provider
addresses, which prevents us from loading the schema. That being said, I
think it shouldn't be an issue, but will come back to revisit this as we
build the support end to end.

Add a test for deferred actions support
2026-03-06 15:54:23 +01:00
Mutahhir Hayat
e133339a83 Add test for planned action invocation hooks, and ensuring the plan is valid 2026-03-06 14:00:31 +01:00
Radek Simko
0fe906fa8c make copyrightfix 2026-02-17 13:56:34 +00:00
Liam Cervante
3d4391865d
stacks: skip resource instance hooks during refresh plans (#37043)
* stacks: skip resource instance hooks during refresh plans

* add copywrite headers
2025-05-15 06:41:38 +00: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
a384d2daa7
stacks: fix deferred data sources and unknown component applies (#35876) 2024-10-22 11:23:53 +02: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
Daniel Schmidt
e50a1ac824
stacks: fix dependency handling in component forget 2024-09-17 14:15:43 +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
0ae6bc34c4
stacks: introduce shared functions for common tests (#35718) 2024-09-12 16:16:15 +02:00
Liam Cervante
6f9df8f5eb
stacks: ensure that all components in state are referenced in configuration (#35677)
* stacks: ensure that all components in state are referenced by a component or resource block

* fix compile error
2024-09-07 14:54:32 +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
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
38033b5c45
stacks: sort diags in test before comparison (#35550) 2024-08-12 14:54:32 +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
Liam Cervante
587a7e88ff
stacks: include move, forget, import counts in apply summaries (#35391) 2024-07-01 14:23:17 +02:00
Daniel Schmidt
b62a67394b
stacks: save plantimestamp to plan 2024-06-25 10:59:56 +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
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
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
Alisdair McDiarmid
97a220fb82 stacks: Use source bundle aware config parser 2024-02-23 13:29:37 -05:00
Liam Cervante
bced645a4d
stacks: call terraform.Validate on stack component configs (#34705) 2024-02-21 10:58:44 +01:00
Liam Cervante
64b311d53a
stacks: apply sensitive marks to outputs from components (#34684)
* stacks: apply sensitive marks to outputs from components

* gen headers

* ensure consistent test ordering
2024-02-16 10:46:50 +01:00
Alisdair McDiarmid
1d3f863f2b stackruntime: Support sensitive component inputs
Components can emit sensitive values as outputs, which can be consumed
as inputs to other components. This commit ensures that such values are
correctly processed in order to pass their sensitivity to the modules
runtime.
2024-01-08 15:27:06 -05:00
Martin Atkins
d1b0632e82 stackruntime: Add HashiCorp copyright comments 2023-11-15 12:38:55 -08:00
Martin Atkins
ea3b70abf0 stackeval: Component calls are now referenceable
This means it's valid to write references like "component.foo" in
expressions in a stack configuration, where the result is built from the
planned output values of the root module of each component instance.

For embedded stacks we intentionally designed the language to require
explicit types on all output values so that we'd still be able to do type
checking even when we can't calculate the output values yet. Unfortunately
we can't do the same trick for components because the main Terraform
module language treats output values as dynamically-typed and so an
output value we can't evaluate yet could have literally any type.

Therefore we concede and just return cty.DynamicVal in most failure cases
here; perhaps a future edition of the main Terraform language can improve
this by requiring explicitly-typed output values there too.
2023-11-15 12:38:53 -08:00
Martin Atkins
791a5fb8a6 stackruntime: Top-level "Validate" function
This is the public entry point for the overall validation of an entire
stack configuration. So far it supports validation only of input variables,
embedded stack calls, and output values. We'll grow this to support other
language constructs in later commits.

This is a relatively large commit due to introducing various supporting
infrastructure to help make evaluation possible at all. Subsequent commits
will hopefully be more focused due to being able to depend on the
foundations introduced here.
2023-11-15 12:38:51 -08:00
Martin Atkins
4754889950 stackruntime: Beginnings of Validate function
This stubs out the basic structure of stackeval's equivalent of a graph
walk, which is really just a recursive tree walk starting async tasks that
might depend on each other via the abstractions in package "promising".

This initial work is sufficient to validate the inputs to an embedded
stack call when referring to input variables in the calling stack, showing
that the expression evaluation model seems to be working and the use of
promises to deal with dependency ordering seems viable.
2023-11-15 12:38:51 -08:00