Commit graph

4149 commits

Author SHA1 Message Date
sahar-azizighannad
011d030751 Merge branch 'main' into stacks-variable-validations
Some checks failed
Quick Checks / Unit Tests (push) Has been cancelled
Quick Checks / Race Tests (push) Has been cancelled
Quick Checks / End-to-end Tests (push) Has been cancelled
Quick Checks / Code Consistency Checks (push) Has been cancelled
2026-03-04 17:20:04 -05:00
sahar-azizighannad
ec5959f80a improvements 2026-03-04 17:19:46 -05:00
Daniel Banck
6f8592eee4 Make dynamic reference error message more precise
Some checks are pending
build / Build for windows_amd64 (push) Blocked by required conditions
build / Build for freebsd_arm (push) Blocked by required conditions
build / Build for linux_arm (push) Blocked by required conditions
build / Build for darwin_arm64 (push) Blocked by required conditions
build / Build for linux_arm64 (push) Blocked by required conditions
build / Build for windows_arm64 (push) Blocked by required conditions
build / Build Docker image for linux_386 (push) Blocked by required conditions
build / Build Docker image for linux_amd64 (push) Blocked by required conditions
build / Build Docker image for linux_arm (push) Blocked by required conditions
build / Build Docker image for linux_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_386 (push) Blocked by required conditions
build / Build e2etest for windows_386 (push) Blocked by required conditions
build / Build e2etest for darwin_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_amd64 (push) Blocked by required conditions
build / Build e2etest for windows_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_arm (push) Blocked by required conditions
build / Build e2etest for darwin_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_arm64 (push) Blocked by required conditions
build / Run e2e test for linux_386 (push) Blocked by required conditions
build / Run e2e test for windows_386 (push) Blocked by required conditions
build / Run e2e test for darwin_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_amd64 (push) Blocked by required conditions
build / Run e2e test for windows_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_arm (push) Blocked by required conditions
build / Run e2e test for linux_arm64 (push) Blocked by required conditions
build / Run terraform-exec test for linux amd64 (push) Blocked by required conditions
Quick Checks / Unit Tests (push) Waiting to run
Quick Checks / Race Tests (push) Waiting to run
Quick Checks / End-to-end Tests (push) Waiting to run
Quick Checks / Code Consistency Checks (push) Waiting to run
2026-03-04 11:45:59 +01:00
Daniel Banck
ee8f7abc04 Add snapshot-related test for the new graph-based config loader
This ensures we test snapshot related configuration loading. These tests
previously lived in the `configload` package.
2026-03-04 11:45:59 +01:00
Daniel Banck
45ba6796ba Add more dynamic module sources tests 2026-03-04 11:45:59 +01:00
Daniel Banck
b6804e2edd Use configuration values for jsonconfig
Instead of outputting the raw values from the ModuleCall, we're now
using the evaluated values from the Config. This should keep the JSON
output unchanged, we just need to make sure to persist the values in
`Config` when loading the configuration.
2026-03-04 11:45:59 +01:00
Daniel Banck
55198eb221 Feedback: Rename remaining static -> const 2026-03-04 11:45:59 +01:00
Daniel Banck
834c2f4c21 Fix modules command
To be able to show version constraint from modules, we now store them
during configuration loading.
2026-03-04 11:45:59 +01:00
Daniel Banck
5a70c424b3 Fix import and show command
This commit moves some code around to fix configuration loading during
the (legacy) import command. And add vars to the show command.
2026-03-04 11:45:59 +01:00
Daniel Banck
297ebd989e Move some planfile tests
To be able to read and build the configuration in planfile related
tests, we need methods from the `terraform` package. This commit moves
the test into that package to make testing easier.
2026-03-04 11:45:59 +01:00
Daniel Banck
0043e1ce24 Update module call configuration storage
This turns the string representation of the source and version attribute
of a module call into an expression. This leads to a change in the JSON
output:

`"source": "./foo"` --> `"source": {"constant_value": "./foo"},`
2026-03-04 11:45:59 +01:00
Daniel Banck
d5d12cdd49 Treat most values as dynamic during init walk
Since init only really cares about references that are used inside a
module source (or version), we can treat all other references as
dynamic/unknown and shortcut most of their validation steps.
2026-03-04 11:45:59 +01:00
Daniel Banck
4ef9684188 Rework most of the configuration loading
We previously used a loader -> BuildConfig flow to load configuration.
This commit changes most (but not all yet) flows to use the new
graph-based approach. Instead of simply recursively loading the modules,
we now need to take a stepped approach:

1. Load the root module
2. Collect the variables and their values
3. Build the configuration with the graph-based approach

Because this approach relies on different parts from different packages,
it can't easliy be done within the `configload` package. So, now we do
most of in the backend or command.
2026-03-04 11:45:59 +01:00
Daniel Banck
fb60c15670 Update init to use new graph-based workflow
The init command and the module installer are now using the new
graph-based workflow to install modules instead of using the recursive
BuildConfig.
2026-03-04 11:45:59 +01:00
Daniel Banck
11d819048a Store module source and version expressions
Instead of evaluating and parsing a module source and version on
configuration loading, we now simply store the expression.

Decoding is now done during the graph-based configuration loading in the
module install node.
2026-03-04 11:45:59 +01:00
Daniel Banck
28b76c1105 Introduce a new init graph
The new init graph builder creates a small graph that can be used to
install or load module configuration. It reuses different walkers to
either install modules or validate the manifest during configuration
loading.

The new module install node dynamically expands the graph after module
installation with a subgraph for the installed module.
2026-03-04 11:45:59 +01:00
Radek Simko
7127c76b04
command/views: Bump UI version to v1.3 (#38231) 2026-03-04 10:09:21 +00:00
Radek Simko
07b3e3b800
command/init: Merge duplicated PSS logic back into existing codepath (#38227) 2026-03-04 08:40:42 +00:00
Mutahhir Hayat
2bb747222b Update copyright for conversion_test.go
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
2026-03-02 17:08:15 +01:00
Mutahhir Hayat
71f0afc644 Include trigger information in progress messages
This disambiguates multiple invocations of the same action instance (see
this excellent comment by @DanielMSchmidt for a better overview
(https://github.com/hashicorp/terraform/pull/38051/changes#r2812460131)
2026-03-02 17:08:15 +01:00
Mutahhir Hayat
551bf42090 Add Action Invocations in ComponenentInstanceChanges 2026-03-02 17:08:15 +01:00
Roniece
a38c47ae72 Add ActionInvocationStatus, ActionInvocationProgress messages 2026-03-02 17:08:15 +01:00
Mutahhir Hayat
7aa0a71078 Create Protobuf changes for stack planning that includes Action invocations 2026-03-02 17:08:15 +01:00
sahar-azizighannad
14116ad820 Merge branch 'main' into stacks-variable-validations
Some checks failed
Quick Checks / Unit Tests (push) Has been cancelled
Quick Checks / Race Tests (push) Has been cancelled
Quick Checks / End-to-end Tests (push) Has been cancelled
Quick Checks / Code Consistency Checks (push) Has been cancelled
2026-03-02 10:22:29 -05:00
sahar-azizighannad
e883bdf3a4 Update input_variable.go
Some checks failed
Quick Checks / Unit Tests (push) Has been cancelled
Quick Checks / Race Tests (push) Has been cancelled
Quick Checks / End-to-end Tests (push) Has been cancelled
Quick Checks / Code Consistency Checks (push) Has been cancelled
2026-02-27 17:55:04 -05:00
sahar-azizighannad
4333e71d22 make the validation 2026-02-27 17:48:33 -05:00
James Bardin
7960f60d21
Merge pull request #38160 from hashicorp/jbardin/inline-type-conversion
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
inline type conversions
2026-02-27 11:11:09 -04:00
Sebastian Rivera
305dba5dcc feat: denote sensitive attribute paths in query start msg
This new field will be consumed in order to redact sensitive values referenced in a list block's input configuration from the query logs. We simply pipe the config schema and the marked values, and include the paths in the query_start log output.
2026-02-27 11:01:23 +01:00
Kristin Laemmert
0ce1ae7cd6
Merge pull request #38204 from hashicorp/mildwonkey/action-prep
Some checks are pending
build / Build for windows_amd64 (push) Blocked by required conditions
build / Build for freebsd_arm (push) Blocked by required conditions
build / Build for linux_arm (push) Blocked by required conditions
build / Build for darwin_arm64 (push) Blocked by required conditions
build / Build for linux_arm64 (push) Blocked by required conditions
build / Build for windows_arm64 (push) Blocked by required conditions
build / Build Docker image for linux_386 (push) Blocked by required conditions
build / Build Docker image for linux_amd64 (push) Blocked by required conditions
build / Build Docker image for linux_arm (push) Blocked by required conditions
build / Build Docker image for linux_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_386 (push) Blocked by required conditions
build / Build e2etest for windows_386 (push) Blocked by required conditions
build / Build e2etest for darwin_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_amd64 (push) Blocked by required conditions
build / Build e2etest for windows_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_arm (push) Blocked by required conditions
build / Build e2etest for darwin_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_arm64 (push) Blocked by required conditions
build / Run e2e test for linux_386 (push) Blocked by required conditions
build / Run e2e test for windows_386 (push) Blocked by required conditions
build / Run e2e test for darwin_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_amd64 (push) Blocked by required conditions
build / Run e2e test for windows_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_arm (push) Blocked by required conditions
build / Run e2e test for linux_arm64 (push) Blocked by required conditions
build / Run terraform-exec test for linux amd64 (push) Blocked by required conditions
Quick Checks / Unit Tests (push) Waiting to run
Quick Checks / Race Tests (push) Waiting to run
Quick Checks / End-to-end Tests (push) Waiting to run
Quick Checks / Code Consistency Checks (push) Waiting to run
simplifying actions prep - renaming action-related node types and some internal fields.
2026-02-26 10:05:14 -05:00
Radek Simko
cd9257cd53
PSS: Enable state store configuration change (#38153) 2026-02-26 15:00:13 +00:00
Sarah French
c37cf1c0f5
test: Enable assertions about prompt text shown to users (#38212)
* test: Update `testInputMap` and `(*UIInput) Input` to allow making assertions about what prompts a user has been shown. Make cleanup happen inside the helper.

* test: Update test to assert about prompt contents, showing how changes to `testInputMap` can be used

* docs: update godoc for testInputMap
2026-02-26 14:57:42 +00:00
Sarah French
9f5f21f1d8
test: Enable mocking http provider sources in tests (#38206)
* test: Update`MockSource` to be able to present providers as being installed via HTTP, add `newMockProviderSourceViaHTTP` for direct use in tests.

Compare newMockProviderSourceViaHTTP to the existing newMockProviderSource. newMockProviderSource uses FakeInstallablePackageMeta, which creates metadata for providers that says it's being sourced from a local archive. In newMockProviderSourceViaHTTP the metadata reports the provider is downloaded via HTTP. The URL is created using a base URL that should be obtained from a test http server created in the test.

* test: Add `newMockProviderSourceUsingTestHttpServer` helper, to abstract away making the http test server. Add test showing it in use.

* refactor: Update test helpers to call t.Cleanup internally
2026-02-26 10:24:13 +00:00
Daniel Schmidt
2424cf6423 make test case more robust to developer environments
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
2026-02-24 18:22:54 +01:00
Kristin Laemmert
70e074b8aa chore (actions): rename LifecycleActionTrigger -> ResourceActionTrigger in plan and proto
We'd previously removed all other references to "lifecycle" actions, which made this reference stand out. ResourceLifecycleActionTrigger is probably the most accurate name, but as this type just needs to be differentiated from InvokeActionTrigger I thought "resource" was enough (and I specifically wanted= to avoid lifecycle at all). I'm not super attached to the name, but I did think it would be clearer if we avoided Lifecycle as much as possible, since that's got some overlap with action subtypes.

In this instance, we call it a LifecycleActionTrigger because it's come from the resource's `lifecycle` block. This doesn't directly relate to the concept of LifecycleActions - even if we expand the design to have multiple action types (for example generic and lifecycle actions), both those actions types would use this same Trigger struct.
2026-02-23 15:17:45 -05:00
Kristin Laemmert
a5dade523b renaming action-related nodes 2026-02-23 15:06:00 -05:00
Daniel Banck
a39e3bce32
make syncdeps 2026-02-23 18:09:29 +01:00
Daniel Schmidt
905845f363 copy rename
Some checks are pending
build / Build for windows_amd64 (push) Blocked by required conditions
build / Build for freebsd_arm (push) Blocked by required conditions
build / Build for linux_arm (push) Blocked by required conditions
build / Build for darwin_arm64 (push) Blocked by required conditions
build / Build for linux_arm64 (push) Blocked by required conditions
build / Build for windows_arm64 (push) Blocked by required conditions
build / Build Docker image for linux_386 (push) Blocked by required conditions
build / Build Docker image for linux_amd64 (push) Blocked by required conditions
build / Build Docker image for linux_arm (push) Blocked by required conditions
build / Build Docker image for linux_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_386 (push) Blocked by required conditions
build / Build e2etest for windows_386 (push) Blocked by required conditions
build / Build e2etest for darwin_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_amd64 (push) Blocked by required conditions
build / Build e2etest for windows_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_arm (push) Blocked by required conditions
build / Build e2etest for darwin_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_arm64 (push) Blocked by required conditions
build / Run e2e test for linux_386 (push) Blocked by required conditions
build / Run e2e test for windows_386 (push) Blocked by required conditions
build / Run e2e test for darwin_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_amd64 (push) Blocked by required conditions
build / Run e2e test for windows_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_arm (push) Blocked by required conditions
build / Run e2e test for linux_arm64 (push) Blocked by required conditions
build / Run terraform-exec test for linux amd64 (push) Blocked by required conditions
Quick Checks / Unit Tests (push) Waiting to run
Quick Checks / Race Tests (push) Waiting to run
Quick Checks / End-to-end Tests (push) Waiting to run
Quick Checks / Code Consistency Checks (push) Waiting to run
2026-02-23 15:38:55 +01:00
Daniel Schmidt
400689c44b hint to provider in case no deprecation message is set 2026-02-23 15:38:55 +01:00
Daniel Schmidt
cd3fc5ba56 expose deprecation on provider schema 2026-02-23 15:38:55 +01:00
Daniel Schmidt
a2e232856b read deprecation message for resource deprecations 2026-02-23 15:38:55 +01:00
Daniel Schmidt
77a54d4c8a improve documentation for deprecation methods 2026-02-23 14:43:00 +01:00
Sarah French
eab282f617
test: Add http backend locking test (#38192)
* test: Update TestHTTPBackend so it can be created with pre-existing lock info inside it. This will be used for tests that want to assert the lock info returned with lock errors.

* test: Add a test asserting data returned in lock errors from the http backend.

* chore: Replace use of `io/ioutil` in http backend

* chore: Update changelog entry to link to the original PR https://github.com/hashicorp/terraform/pull/38144

* test: Improve test code comments
2026-02-18 18:51:43 +00:00
Nicholas Ngai
5e4cfd42fa
backend/http: Return existing lock info from backend on conflict (#38144)
* Return existing lock info from http state backend on conflict

* Remove info from LockError if failed to read or unmarshal

* Add change to .changes
2026-02-18 17:00:54 +00:00
Sarah French
ee3190aab4
fix: Add check that we're able to run the e2e.GoBuild method in TestPrimary_stateStore_unmanaged_separatePlan (#38190)
This change should hopefully address E2E failures that are happening on main. It's hard to test that as the failures are platform specific and neither my laptop nor the runner for tests on PRs matches the failing platforms.
2026-02-18 14:42:41 +01:00
Sarah French
3db7c751a8
PSS: Fix use of reattached providers in init, enable use of reattached providers during plan-apply workflow (#38182)
* refactor: Check that the state storage provider is present when beginning to initialise a state store for use in a non-init command. Ensure reattached providers can be used.

Previously we passed all required providers into backend options to be used within `stateStoreConfig`, which is invoked via (Meta).Backend. The new approach enforces that the provider is present while assembling the backend options passed to (Meta).Backend from (Meta).backend, which is non-init specific. As this code is defending against users running non-init commands before an init, this place feels appropriate and isn't able to impact the init command.

* fix: Reattached PSS providers should return early when checking locks, and an empty locks file is only bad if there isn't a reattached PSS provider

* test: Assert that running init with reattached PSS provider is ok, via an E2E test that uses the reattach feature.

* fix: Allow builtin or reattached providers to be used for state stores when generating a plan file

* test: Expand E2E test to show using a reattached provider can be used for a workflow of init, plan with -out, and apply.

* chore: Replace 'io/ioutil' and format code in unmanaged e2e tests
2026-02-18 11:53:15 +00:00
Daniel Schmidt
d4d46b38a2 remove unused Meta.variableArgs 2026-02-18 12:47:12 +01:00
Daniel Schmidt
de068da2ab refactor addVarsFromFile to use return value 2026-02-18 12:47:12 +01:00
Daniel Schmidt
b003de9c1f remove unused function 2026-02-18 12:47:12 +01:00
Daniel Schmidt
93f4c1b9b4 remove copied default value 2026-02-18 12:47:12 +01:00
Daniel Schmidt
fd8d61ac9b use pre-existing loaders where possible 2026-02-18 12:47:12 +01:00