terraform/internal/command/testdata
Kristin Laemmert 096010600d
terraform: use hcl.MergeBodies instead of configs.MergeBodies for pro… (#29000)
* terraform: use hcl.MergeBodies instead of configs.MergeBodies for provider configuration

Previously, Terraform would return an error if the user supplied provider configuration via interactive input iff the configuration provided on the command line was missing any required attributes - even if those attributes were already set in config.

That error came from configs.MergeBody, which was designed for overriding valid configuration. It expects that the first ("base") body has all required attributes. However in the case of interactive input for provider configuration, it is perfectly valid if either or both bodies are missing required attributes, as long as the final body has all required attributes. hcl.MergeBodies works very similarly to configs.MergeBodies, with a key difference being that it only checks that all required attributes are present after the two bodies are merged.

I've updated the existing test to use interactive input vars and a schema with all required attributes. This test failed before switching from configs.MergeBodies to hcl.MergeBodies.

* add a command package test that shows that we can still have providers with dynamic configuration + required + interactive input merging

This test failed when buildProviderConfig still used configs.MergeBodies instead of hcl.MergeBodies
2021-06-25 08:48:47 -04:00
..
add commands: `terraform add` (#28874) 2021-06-17 12:08:37 -04:00
apply Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-config-invalid Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-destroy-targeted Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-error Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-input Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-input-partial Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-plan-no-module Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-replace Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-sensitive-output Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-shutdown Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-targeted Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-terraform-env Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
apply-vars Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-change Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-change-multi-default-to-single Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-change-multi-to-multi Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-change-multi-to-no-default-with-default Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-change-multi-to-no-default-without-default Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-change-multi-to-single Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-change-single-to-single Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-changed-with-legacy Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-from-state Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-inmem-locked Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-new Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-new-interp Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-new-legacy Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-new-migrate Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-new-migrate-existing Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-plan-backend-empty Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-plan-backend-empty-config Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-plan-backend-match Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-plan-backend-mismatch Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-plan-legacy Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-plan-legacy-data Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-plan-local Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-plan-local-match Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-plan-local-mismatch-lineage Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-plan-local-newer Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-unchanged Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-unchanged-with-legacy Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-unset Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
backend-unset-with-legacy Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
empty Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
fmt Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
get Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
graph Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-missing-resource-config Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-module-input-variable Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-module-var-file Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-provider Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-provider-aliased Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-provider-datasource Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-provider-implicit Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-provider-invalid Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-provider-remote-state Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-provider-var Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-provider-var-default Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
import-provider-var-file Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-backend Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-backend-config-file Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-backend-config-file-change Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-backend-config-kv Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-backend-empty Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-check-required-version Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-get Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-get-provider-detected-legacy Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-get-provider-invalid-package Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-get-provider-legacy-from-state Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-get-provider-source Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-get-providers Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-internal Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-internal-invalid Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-legacy-provider-cache Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-legacy-rc Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-provider-lock-file Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-provider-lock-file-readonly-add Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-providers-lock Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
init-required-providers Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
inmem-backend Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
login-oauth-server Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
login-tfe-server Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
modules Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
parallelism Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
plan Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
plan-emptydiff Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
plan-invalid Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
plan-out-backend Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
plan-out-backend-legacy Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
plan-provider-input terraform: use hcl.MergeBodies instead of configs.MergeBodies for pro… (#29000) 2021-06-25 08:48:47 -04:00
plan-replace Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
plan-vars Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
providers Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
providers-lock/basic providers subcommand tests (#28744) 2021-05-19 12:56:16 -04:00
providers-schema Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
push Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
push-backend-new Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
push-input Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
push-input-partial Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
push-no-remote Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
push-no-upload Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
push-tfvars Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
refresh Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
refresh-empty Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
refresh-output Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
refresh-targeted Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
refresh-unset-var Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
refresh-var Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
show Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
show-json json-output: Omit unchanged resource_drift entries 2021-06-17 15:09:16 -04:00
show-json-sensitive jsonplan and jsonstate: include sensitive_values in state representations (#28889) 2021-06-14 09:19:13 -04:00
show-json-state jsonplan and jsonstate: include sensitive_values in state representations (#28889) 2021-06-14 09:19:13 -04:00
state-list-backend-custom Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
state-list-backend-default Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
state-list-nested-modules Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
state-pull-backend Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
state-push-bad-lineage Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
state-push-good Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
state-push-replace-match Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
state-push-serial-newer Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
state-push-serial-older Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
taint-check-required-version Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
test-fails Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
test-passes Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
validate-invalid Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
validate-valid Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
variables Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
empty-file Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
statelocker.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00