Commit graph

1071 commits

Author SHA1 Message Date
Sarah French
ac7206c919
test: Fix E2E tests to use correct errors for assertions, remove use of ioutil in package (#38254)
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-10 13:34:18 +00:00
Daniel Schmidt
a9756b273c move initwd config loading into terraform
otherwise we run into cyclic references
2026-03-06 11:59:59 +01:00
Daniel Schmidt
0c796986bb move load config calls to new mechanism 2026-03-06 11:59:59 +01:00
Daniel Banck
02723fcd79 Add variable arguments to init help text
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-05 16:48:47 +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
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
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
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
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
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
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
Daniel Schmidt
cd3fc5ba56 expose deprecation on provider schema 2026-02-23 15:38:55 +01: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
Daniel Schmidt
4e921a8eae move CollectValuesFromTests to arguments package
This keeps the CollectValues and CollectValuesFromTests implementations
together.
2026-02-18 12:47:12 +01:00
Daniel Schmidt
26124c0dde removed unused collectVariableValues 2026-02-18 12:47:12 +01:00
Daniel Schmidt
1190b52995 use centralized arguments collection in test 2026-02-18 12:47:12 +01:00
Daniel Schmidt
065794ba8b use centralized arguments collection in console 2026-02-18 12:47:12 +01:00
Daniel Schmidt
f6a3f271be refactor console command to use arguments 2026-02-18 12:47:12 +01:00
Daniel Schmidt
3dce16079c use centralized arguments collection in import 2026-02-18 12:47:12 +01:00
Daniel Schmidt
b883c69e3b use centralized arguments collection in refresh 2026-02-18 12:47:12 +01:00
Daniel Schmidt
e9922645d7 use centralized arguments collection in query 2026-02-18 12:47:12 +01:00
Daniel Schmidt
a5b4ed33d5 use centralized arguments collection in plan 2026-02-18 12:47:12 +01:00
Daniel Schmidt
dc0fee96ef use centralized arguments collection in apply 2026-02-18 12:47:12 +01:00
Daniel Schmidt
8faccde780 implement centralized variable collection 2026-02-18 12:47:12 +01:00
Daniel Schmidt
026c935961 move UnparsedVariableValue from backendrun to arguments
This prevents a cyclic dependency and also makes sense semantically.
The arguments package will collect the unparsed variable values and
the backendrun helpers will work to collect the values and transform
them into terraform.InputValue.
2026-02-18 12:47:12 +01:00
Daniel Schmidt
90eae782bf move vars handling into own file 2026-02-18 12:47:12 +01:00
Daniel Schmidt
81b328f924
update copyright headers 2026-02-17 15:56:24 +01:00
Daniel Schmidt
d09d5ea60f
remove now unused method 2026-02-17 15:55:45 +01:00
Daniel Schmidt
592d0fe4dd
don't explicitly specify defaults in argument parsing 2026-02-17 15:55:45 +01:00
Daniel Schmidt
5e51b831be
refactor state-replace-provider command argument parsing 2026-02-17 15:55:45 +01:00
Daniel Schmidt
32fb18572d
don't explicitly specify defaults in argument parsing 2026-02-17 15:55:45 +01:00
Daniel Schmidt
89bea5de5b
refactor state-rm command argument parsing 2026-02-17 15:55:45 +01:00
Daniel Schmidt
c66d0d72c1
don't explicitly specify defaults in argument parsing 2026-02-17 15:55:45 +01:00
Daniel Schmidt
442126553b
refactor state-push command argument parsing 2026-02-17 15:55:45 +01:00
Daniel Schmidt
b9f6f14003
don't explicitly specify defaults in argument parsing 2026-02-17 15:55:45 +01:00