terraform/internal/command
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
..
arguments refactor addVarsFromFile to use return value 2026-02-18 12:47:12 +01:00
cliconfig make copyrightfix 2026-02-17 13:56:34 +00:00
clistate make copyrightfix 2026-02-17 13:56:34 +00:00
e2etest PSS: Fix use of reattached providers in init, enable use of reattached providers during plan-apply workflow (#38182) 2026-02-18 11:53:15 +00:00
format make copyrightfix 2026-02-17 13:56:34 +00:00
jsonchecks make copyrightfix 2026-02-17 13:56:34 +00:00
jsonconfig make copyrightfix 2026-02-17 13:56:34 +00:00
jsonformat make copyrightfix 2026-02-17 13:56:34 +00:00
jsonfunction make copyrightfix 2026-02-17 13:56:34 +00:00
jsonplan make copyrightfix 2026-02-17 13:56:34 +00:00
jsonprovider make copyrightfix 2026-02-17 13:56:34 +00:00
jsonstate make copyrightfix 2026-02-17 13:56:34 +00:00
junit make copyrightfix 2026-02-17 13:56:34 +00:00
testdata feat: Enable validate command to validate state_store blocks. (#38157) 2026-02-16 10:09:26 +00:00
testing make copyrightfix 2026-02-17 13:56:34 +00:00
views make copyrightfix 2026-02-17 13:56:34 +00:00
webbrowser make copyrightfix 2026-02-17 13:56:34 +00:00
workdir PSS: Fix use of reattached providers in init, enable use of reattached providers during plan-apply workflow (#38182) 2026-02-18 11:53:15 +00:00
apply.go use pre-existing loaders where possible 2026-02-18 12:47:12 +01:00
apply_destroy_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
apply_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
autocomplete.go make copyrightfix 2026-02-17 13:56:34 +00:00
autocomplete_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
cli_ui.go make copyrightfix 2026-02-17 13:56:34 +00:00
cli_ui_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
cloud.go make copyrightfix 2026-02-17 13:56:34 +00:00
cloud_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
command.go remove copied default value 2026-02-18 12:47:12 +01:00
command_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
console.go use pre-existing loaders where possible 2026-02-18 12:47:12 +01:00
console_interactive.go make copyrightfix 2026-02-17 13:56:34 +00:00
console_interactive_solaris.go make copyrightfix 2026-02-17 13:56:34 +00:00
console_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
experimental_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
flag_kv.go make copyrightfix 2026-02-17 13:56:34 +00:00
flag_kv_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
fmt.go make copyrightfix 2026-02-17 13:56:34 +00:00
fmt_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
get.go make copyrightfix 2026-02-17 13:56:34 +00:00
get_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
graph.go make copyrightfix 2026-02-17 13:56:34 +00:00
graph_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
helper.go make copyrightfix 2026-02-17 13:56:34 +00:00
hook_module_install.go make copyrightfix 2026-02-17 13:56:34 +00:00
import.go use pre-existing loaders where possible 2026-02-18 12:47:12 +01:00
import_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
init.go make copyrightfix 2026-02-17 13:56:34 +00:00
init_run.go remove unused Meta.variableArgs 2026-02-18 12:47:12 +01:00
init_run_experiment.go PSS: Fix use of reattached providers in init, enable use of reattached providers during plan-apply workflow (#38182) 2026-02-18 11:53:15 +00:00
init_test.go PSS: Fix use of reattached providers in init, enable use of reattached providers during plan-apply workflow (#38182) 2026-02-18 11:53:15 +00:00
login.go make copyrightfix 2026-02-17 13:56:34 +00:00
login_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
logout.go make copyrightfix 2026-02-17 13:56:34 +00:00
logout_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
meta.go remove unused Meta.variableArgs 2026-02-18 12:47:12 +01:00
meta_backend.go PSS: Fix use of reattached providers in init, enable use of reattached providers during plan-apply workflow (#38182) 2026-02-18 11:53:15 +00:00
meta_backend_errors.go make copyrightfix 2026-02-17 13:56:34 +00:00
meta_backend_migrate.go make copyrightfix 2026-02-17 13:56:34 +00:00
meta_backend_migrate_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
meta_backend_test.go PSS: Fix use of reattached providers in init, enable use of reattached providers during plan-apply workflow (#38182) 2026-02-18 11:53:15 +00:00
meta_config.go make copyrightfix 2026-02-17 13:56:34 +00:00
meta_dependencies.go make copyrightfix 2026-02-17 13:56:34 +00:00
meta_dependencies_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
meta_new.go make copyrightfix 2026-02-17 13:56:34 +00:00
meta_providers.go make copyrightfix 2026-02-17 13:56:34 +00:00
meta_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
metadata_command.go make copyrightfix 2026-02-17 13:56:34 +00:00
metadata_functions.go make copyrightfix 2026-02-17 13:56:34 +00:00
metadata_functions_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
modules.go make copyrightfix 2026-02-17 13:56:34 +00:00
modules_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
output.go make copyrightfix 2026-02-17 13:56:34 +00:00
output_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
plan.go use pre-existing loaders where possible 2026-02-18 12:47:12 +01:00
plan_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
plugins.go make copyrightfix 2026-02-17 13:56:34 +00:00
plugins_lock.go make copyrightfix 2026-02-17 13:56:34 +00:00
plugins_lock_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
plugins_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
providers.go refactor providers command argument parsing 2026-02-17 15:55:36 +01:00
providers_lock.go refactor providers lock command argument parsing 2026-02-17 15:55:45 +01:00
providers_lock_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
providers_mirror.go refactor providers mirror command argument parsing 2026-02-17 15:55:36 +01:00
providers_mirror_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
providers_schema.go refactor providers schema command argument parsing 2026-02-17 15:55:36 +01:00
providers_schema_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
providers_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
push.go make copyrightfix 2026-02-17 13:56:34 +00:00
query.go use pre-existing loaders where possible 2026-02-18 12:47:12 +01:00
query_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
refresh.go use pre-existing loaders where possible 2026-02-18 12:47:12 +01:00
refresh_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
show.go make copyrightfix 2026-02-17 13:56:34 +00:00
show_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
stacks.go make copyrightfix 2026-02-17 13:56:34 +00:00
stacks_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_command.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_identities.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_identities_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_list.go refactor state-list command argument parsing 2026-02-17 15:55:45 +01:00
state_list_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_meta.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_mv.go refactor state-mv command argument parsing 2026-02-17 15:55:45 +01:00
state_mv_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_pull.go refactor state-pull command argument parsing 2026-02-17 15:55:45 +01:00
state_pull_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_push.go refactor state-push command argument parsing 2026-02-17 15:55:45 +01:00
state_push_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_replace_provider.go refactor state-replace-provider command argument parsing 2026-02-17 15:55:45 +01:00
state_replace_provider_test.go refactor state-replace-provider command argument parsing 2026-02-17 15:55:45 +01:00
state_rm.go refactor state-rm command argument parsing 2026-02-17 15:55:45 +01:00
state_rm_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_show.go refactor state-show command argument parsing 2026-02-17 15:55:45 +01:00
state_show_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
state_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
taint.go use the arguments package for taint commands 2026-02-17 15:55:36 +01:00
taint_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
telemetry.go make copyrightfix 2026-02-17 13:56:34 +00:00
test.go remove unused Meta.variableArgs 2026-02-18 12:47:12 +01:00
test_cleanup.go make copyrightfix 2026-02-17 13:56:34 +00:00
test_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
ui_input.go make copyrightfix 2026-02-17 13:56:34 +00:00
ui_input_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
unlock.go make copyrightfix 2026-02-17 13:56:34 +00:00
unlock_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
untaint.go use the arguments package for taint commands 2026-02-17 15:55:36 +01:00
untaint_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
validate.go make copyrightfix 2026-02-17 13:56:34 +00:00
validate_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
version.go make copyrightfix 2026-02-17 13:56:34 +00:00
version_test.go make copyrightfix 2026-02-17 13:56:34 +00:00
workspace_command.go make copyrightfix 2026-02-17 13:56:34 +00:00
workspace_command_test.go remove copied default value 2026-02-18 12:47:12 +01:00
workspace_delete.go make copyrightfix 2026-02-17 13:56:34 +00:00
workspace_list.go make copyrightfix 2026-02-17 13:56:34 +00:00
workspace_new.go make copyrightfix 2026-02-17 13:56:34 +00:00
workspace_select.go make copyrightfix 2026-02-17 13:56:34 +00:00
workspace_show.go make copyrightfix 2026-02-17 13:56:34 +00:00