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
Liam Cervante
fbd5a7930e
stacks: allow removed blocks to target components in nested stacks ( #36787 )
...
* stacks: allow removed blocks to target components in nested stacks
* make copywrite fix
* fix comments
2025-04-03 10:29:18 +02:00
Liam Cervante
7fadbe34de
write-only attributes: internal providers should set write-only attributes to null ( #36824 )
...
* write-only attributes: internal providers should set write-only attributes to null
* add changelog
* fix copywrite headers
2025-04-02 15:58:42 +02:00
Liam Cervante
c8044baf47
stacks: emit state updates for unclaimed components ( #36702 )
...
* stacks: allow multiple removed blocks to target the same component
* make linter happy
* stacks: emit state updates for unclaimed components
2025-04-02 08:39:10 +02:00
Liam Cervante
9707a27ee6
stacks: rename Removed to RemovedComponent in stackeval ( #36782 )
...
* stacks: provide stack and config on component creation
* stacks: rename Removed to RemovedComponent in stackeval
* renamed function calls also
2025-04-01 07:08:02 +00:00
Liam Cervante
7bec38bf5f
stacks: provide stack and config on component creation ( #36778 )
2025-04-01 08:34:05 +02:00
Liam Cervante
ebdf52cd09
stacks: remove all the unnecessary ctx function parameters ( #36762 )
...
* stacks: remove all the unnecessary ctx function parameters
* fix missing context
2025-03-26 12:34:23 +00:00
Liam Cervante
f82ae44484
stacks: make promises identify themselves ( #36749 )
...
* stacks: refactor promises so they declare id when starting
* stacks: add some missing perEval promises
* formatting
2025-03-26 13:25:45 +01:00
Samsondeen
71dbc7d726
migrate command for terraform stacks ( #36482 )
2025-03-19 10:39:50 +01:00
Samsondeen
8b7e7ad27d
Detect circular references during Validation ( #36709 )
2025-03-19 10:39:23 +01:00
Liam Cervante
9bbe34daa4
stacks: pre-destroy refresh should use a normal plan ( #36696 )
...
* stacks: pre-destroy refresh should use a normal plan
* format
2025-03-18 09:28:31 +01:00
Liam Cervante
c16d466773
stacks: allow multiple removed blocks to target the same component ( #36693 )
...
* stacks: allow multiple removed blocks to target the same component
* make linter happy
2025-03-18 08:54:27 +01:00
Daniel Schmidt
bc901abcc5
stacks: test resource identity
2025-03-12 14:46:50 +01:00
Liam Cervante
d4d92ea0b9
Fix broken build due to merge conflicts ( #36679 )
2025-03-12 09:47:07 +00:00
Liam Cervante
3d014d82f3
stacks: fix errors processing index keys of removed blocks ( #36673 )
2025-03-12 10:33:18 +01:00
Daniel Schmidt
fec6e4b552
send resource identities to provider calls
2025-03-12 09:18:55 +01:00
Daniel Banck
b2b42c0fb4
Store resource identities in state (TF-23255) ( #36464 )
...
* Persist resource identity in Terraform state
* make syncdeps
* Move identity schema merging closer to the protocol
* mock GetResourceIdentitySchemas
* Fix identity refresh tests
* Add more tests
* Change grcpwrap upgrade identity
* Review feedback
* Remove unnecessary version conversion
* Check if GetResourceIdentitySchemas RPC call is implemented
* Update function signature docs
* Adapt protocol changes
* Check unimplemented error for identities in GetSchema
2025-03-11 20:58:44 +01:00
Daniel Banck
10c9b64007
Rename schema.Block to Body ( #36629 )
2025-03-04 16:33:43 +01:00
James Bardin
3b3e4bf003
update the rest of the go:generate calls
2025-02-12 12:25:58 -05: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
Samsondeen
aec7c3cc89
terraform test: allow computed/mocked values override during planning ( #36227 )
2025-01-08 12:39:03 +01:00
Daniel Schmidt
0ff1b77afa
standardize client capabilities
2025-01-06 16:27:37 +01:00
Daniel Schmidt
3a962e8e7e
ephemeral: add WriteOnlyAttributesAllowed client capability
...
we allow it for all requests
2024-12-12 10:56:40 +01:00
Liam Cervante
a384d2daa7
stacks: fix deferred data sources and unknown component applies ( #35876 )
2024-10-22 11:23:53 +02:00
James Bardin
57a2e545fb
Merge pull request #35834 from hashicorp/jbardin/ephemeral-close
...
core: place ephemeral close nodes more acurately
2024-10-12 09:52:17 -04:00
Liam Cervante
7eb94fa7c8
stacks: fix tests broken now that ephemeral outputs aren't allowed
2024-10-11 10:23:10 +02:00
Daniel Schmidt
8ce424dbb5
Merge pull request #35826 from hashicorp/TF-18610
...
stacks: root level outputs should not allow ephemeral values
2024-10-10 18:12:05 +02:00
James Bardin
3a1a9408d9
fix Descendants spelling
...
this has proliferated everywhere
2024-10-09 11:09:02 -04: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
Daniel Schmidt
d3e295da03
stacks: root level outputs should not allow ephemeral values
...
For embedded stacks we allow ephemeral values since they might be
consumed by other stacks / components. If a root level stack has an
ephemeral output it means we would need to display the ephemeral value
somewhere which goes against the ephemerality concept.
2024-10-08 15:21:49 +02:00
James Bardin
384f2d4fab
update collections to use for-range method
2024-10-04 11:22:44 -04:00
UKEME BASSEY
a56a4190aa
Merge pull request #35774 from hashicorp/TF-20569-prevent-panic-when-input-variable-is-sensitive
...
Prevent panic when input or output variable is sensitive
2024-09-25 16:19:00 -04:00
UKEME BASSEY
892a96e4b4
add test
2024-09-24 23:48:59 -04:00
UKEME BASSEY
d89ee04e9e
prevent panic when input or output variables are sensitive
2024-09-24 23:47:40 -04:00
Graham Davison
6883ab0ecf
Updates for OTel SDK 1.30
2024-09-23 13:54:20 -07:00
James Bardin
aea5c0cc18
Merge pull request #35750 from hashicorp/jbardin/ephemeral-proto
...
Add protobuf definitions for the ephemeral RPCs
2024-09-20 11:18:54 -04:00
James Bardin
9c3dc8f73a
ephemeral protocol rename
...
Add `Resource` to all the ephemeral protocol symbols to make them
consistent with existing naming conventions.
2024-09-20 11:08:53 -04:00
Liam Cervante
db132eefac
stacks: stacks destroy ordering should match Terraform ( #35748 )
...
* add tests that highlight known issues in the destroy mechanism
* stacks: stacks destroy ordering should match Terraform
2024-09-20 08:20:32 +02:00
James Bardin
1a72b39d42
fill out remaining ephemeral implementations
...
Complete the remaining provider implementations to satisfy the updated
internal interface as well as the new protobuf interfaces.
2024-09-19 10:52:09 -04: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
James Bardin
892172a185
Merge pull request #35727 from hashicorp/jbardin/ephemeral-resources
...
ephemeral resource addresses and interface definitions
2024-09-18 11:01:32 -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
e78294d42b
stacks: stop encoding values into msgpack twice ( #35734 )
2024-09-18 10:18:01 +02:00
Daniel Schmidt
e50a1ac824
stacks: fix dependency handling in component forget
2024-09-17 14:15:43 +02:00
Liam Cervante
598648b66f
stacks: handle input and output state during delete plans ( #35726 )
2024-09-16 12:00:48 +02:00
Liam Cervante
3b30caa42b
stacks: mark input and output changes as no-ops when no changes ( #35725 )
2024-09-16 11:53:21 +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
Daniel Schmidt
f1b7faf901
stacks: remove TODO
2024-09-16 10:20:30 +02:00
Daniel Schmidt
ceb52e65bb
stacks: support forgetting components
2024-09-16 10:20:29 +02:00
James Bardin
9e8c21866e
ephemeral in stacks stubs
2024-09-13 08:55:48 -04:00
Liam Cervante
0ae6bc34c4
stacks: introduce shared functions for common tests ( #35718 )
2024-09-12 16:16:15 +02:00
Liam Cervante
99a94908e7
stacks: do not include removed block instances that do not exist in state ( #35693 )
...
* stacks: include a warning if a removed block targets a non-existent component
* check plan/apply stages separately
* no warning
2024-09-10 15:56:37 +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
b22db510d4
stacks: error when removing a component still in config ( #35692 )
2024-09-10 08:50:09 +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
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
436b72b63b
stacks: fix memory leak caused by unclosed providers ( #35678 )
...
* stacks: make the mock provider error if it's not cleaned up
* stacks: start and clean up unconfigured clients once
2024-09-07 14:22:16 +02:00
Liam Cervante
b6ac98122b
stacks: refactor shared functionality in prep for removed blocks ( #35670 )
2024-09-05 13:15:53 +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
36f11851a6
stacks: refactor the mock provider for realism ( #35654 )
2024-09-05 11:29:15 +02:00
Liam Cervante
11f431196d
stacks: remove unneeded required components functions ( #35648 )
2024-09-05 11:21:05 +02:00
Liam Cervante
cb7bae3217
stacks: remove stale state during Stack apply operations ( #35639 )
2024-08-28 09:23:41 +02:00
Liam Cervante
50233d7a78
stacks: support sensitive input values in planned changes ( #35640 )
...
* stacks: support sensitive input values in planned changes
* stacks: Fix panic when applying sensitive inputs
The stacks-specific check that a given plan's input variable values
remain unchanged at apply time would previously panic when given a
marked value. Marks are not important for this check, so we simply
remove them to ensure that it passes. This seems in line with how
AssertObjectCompatible works, which I'm taking as precedent.
The new test added in this commit panics without the corresponding code
change.
---------
Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>
2024-08-27 16:13:59 +02:00
Liam Cervante
40dc5c02d5
stacks: ensure providers that should not be configured cannot be ( #35624 )
...
* stacks: ensure providers that should not be configured cannot be
* address comments
2024-08-23 09:25:16 +02:00
James Bardin
20f66dffd0
fixup new test comparator
2024-08-22 09:40:47 -04:00
James Bardin
0b8fbfe323
ignore unexported state field in comparison
...
and unify the options used to compare changes in tests
2024-08-22 09:39:37 -04: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
7660d8d086
stacks: fix suggested command when lock file is out of date ( #35616 )
2024-08-21 09:32:08 +02:00
Liam Cervante
047c1af0b4
stacks: add tests for state manipulation failure cases ( #35589 )
2024-08-19 11:45:08 +02:00
Liam Cervante
bb73fb1d69
stacks: don't validate input variables during the apply phase ( #35561 )
2024-08-14 09:47:13 +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
38033b5c45
stacks: sort diags in test before comparison ( #35550 )
2024-08-12 14:54:32 +02:00
Liam Cervante
915b174da3
stacks: split the terraform1 RPC package into per-service packages ( #35513 )
...
* stacks: split the terraform1 RPC package into per-service packages
* pull latest changes
2024-08-07 17:33:51 +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
0c67edd598
stacks: ensure input values for components don't change between plan and apply ( #35489 )
...
* stacks: ensure input values for components don't change between plan and apply
* skip ephemeral values
2024-07-30 08:39:36 +02:00
Liam Cervante
33c0ae7f09
stacks: add additional provider validation tests ( #35471 )
2024-07-26 11:36:08 +02:00
Liam Cervante
e704da535e
stack: stacks should be applyable even if no components are ( #35498 )
2024-07-25 08:04:24 +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
Martin Atkins
170cca1332
stacks+promising: Better error messages for promise resolution failure
...
We were previously just treating promising.ErrUnresolved as a singleton
that doesn't carry any context along with it. This particular error always
represents a bug in the stack runtime rather than a problem with the input,
because resolving all of the promises is a key part of the contract for
package promising, but it's still helpful to know a little more about what
exactly has failed when debugging it.
Therefore promising.ErrUnresolved is now a type rather than a value, and
its carries with it a set of promise ids that were left unresolved. The
stackeval package then recognizes this error type and uses its own records
of what each promise was supposed to produce to hopefully return a useful
error message that would narrow down what part of the system is buggy.
Since this message always reflects a bug in Terraform the error message
will probably just be copy-pasted into a bug report, and so this particular
diagnostic type (unlike the one we use for promise self-references) only
has one presentation form that we use regardless of how many promises
we have to return.
2024-07-23 08:32:25 -07:00
Martin Atkins
ec2510fc3d
stacks: Track raw stack as separate messages in raw plan
...
Previously we had the entire raw prior state serialized as part of the
"plan header" message in the raw plan, which meant that the maximum state
size was constrained by the maximum allowed gRPC message size.
Instead now we'll use a separate raw plan element for each raw prior state
element, so that we're limited only in the size of individual items rather
than size of the state as a whole.
This deals with the last remaining (non-deprecated) case where our RPC
protocol tries to pack an entire raw state or plan into a single protobuf
message, and so we're now standardized on using a streaming approach in
all cases.
2024-07-17 11:08:16 -07:00
Alisdair McDiarmid
d828776757
stacks+rpcapi: Load prior state and plan separately
...
Previously we expected clients to provide an inline raw prior state to
PlanStackChanges and an inline raw plan to ApplyStackChanges, which was
a simpler design but meant that we might end up generating a state or plan
that's too large to be submitted in a single gRPC request, which would then
be difficult to resolve.
Instead we'll offer separate RPC functions for loading raw state and plan
using a gRPC streaming approach, which better mirrors the streaming
approach we use to _emit_ these artifacts. Although we don't actually need
this benefit right now, this makes it possible in principle for a client
that's running PlanStackChanges to feed back the raw planned actions
concurrently into OpenPlan and thus avoid buffering the whole plan on the
client side at all.
This required resolving the pre-existing FIXME about the inconsistency
where stackeval wants a raw plan for apply but expects the caller to
have dealt with loading the prior state for planning. Here it's resolved
in the direction of the caller (rpcapi) always being responsible for
loading both artifacts, because that means we can continue supporting the
old inline approach for a while without that complexity having to infect
the lower layers.
Ideally we should remove the legacy approach before this API becomes
constrained by compatibility promises, but I've preserved the old API
for now to give us some flexibility in when we update the existing
clients of this API to use the new approach.
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2024-07-17 11:08:16 -07: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
Daniel Schmidt
591c3dea36
Merge pull request #35433 from hashicorp/TF-10919
...
stacks: add new deferred plan status
2024-07-10 17:08:24 +02:00
Liam Cervante
634155f56b
stacks: extend diagnostic message to capture error from unscheduled component ( #35434 )
2024-07-09 13:05:47 +02:00
Daniel Schmidt
93cf093168
stacks: add new deferred plan status
2024-07-08 12:49:00 +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
4f401d9cd3
stacks: add dependency lock to new test case
2024-07-03 19:25:27 +02:00
Daniel Schmidt
bf5037fa05
stacks: add test case
2024-07-03 14:43:04 +02:00
Daniel Schmidt
9f8ab0450c
stacks: fix move apply test
2024-07-03 14:43:03 +02:00
Daniel Schmidt
2a3c579693
stacks: use inspecting phase for provider config tests
2024-07-03 14:42:29 +02:00
Daniel Schmidt
05755422f3
stacks: pass dependency lock in tests
2024-07-03 14:42:25 +02:00
Daniel Schmidt
4433239da4
stacks: validate dependency lockfile in apply phase
2024-07-03 14:41:08 +02:00