opentofu/internal/terraform
kmoe 765c25d2ed
allow interpolation in import block id (#33618)
The import block id field can now reference variables, attributes, and module outputs, as long as the result is a known non-empty string at plan time. A null or unknown value will result in an error.

This commit slightly modifies the legacy CLI terraform import code path to construct a synthetic hcl.Expression from the import id passed in from the command line, with no intended change of functionality.
2023-08-02 10:20:27 +01:00
..
testdata allow interpolation in import block id (#33618) 2023-08-02 10:20:27 +01:00
context_apply2_test.go [Testing Framework] Adds TestContext for evaluating test assertions (#33326) 2023-06-26 17:42:53 +02:00
context_apply_checks_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_apply_test.go always evaluate module outputs during destroy 2023-06-30 15:24:49 -04:00
context_apply.go [Testing Framework] Adds TestContext for evaluating test assertions (#33326) 2023-06-26 17:42:53 +02:00
context_eval_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_eval.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_fixtures_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_import_test.go allow interpolation in import block id (#33618) 2023-08-02 10:20:27 +01:00
context_import.go allow interpolation in import block id (#33618) 2023-08-02 10:20:27 +01:00
context_input_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_input.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_plan2_test.go allow interpolation in import block id (#33618) 2023-08-02 10:20:27 +01:00
context_plan_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_plan.go [Testing Framework] Adds TestContext for evaluating test assertions (#33326) 2023-06-26 17:42:53 +02:00
context_plugins_test.go update providers.Schemas type 2023-07-06 10:37:35 -04:00
context_plugins.go enable global schema cache 2023-07-10 11:01:19 -04:00
context_refresh_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_refresh.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_validate_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_validate.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context_walk.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
context.go remove fixed FIXME 2023-07-06 10:56:03 -04:00
diagnostics.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
eval_conditions.go [testing framework] implement expect_failures functionality (#33443) 2023-07-10 11:30:44 +01:00
eval_context_builtin_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
eval_context_builtin.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
eval_context_mock.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
eval_context.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
eval_count_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
eval_count.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
eval_for_each_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
eval_for_each.go Introduce separate testing scope for reference validation (#33339) 2023-06-28 09:47:24 +02:00
eval_import.go allow interpolation in import block id (#33618) 2023-08-02 10:20:27 +01:00
eval_provider_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
eval_provider.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
eval_variable_test.go Add input validation into the 'checks' outputs and tracking (#33481) 2023-07-10 11:33:45 +01:00
eval_variable.go testing framework: finalise expect_failures functionality (#33506) 2023-07-19 09:44:40 +02:00
evaluate_test.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
evaluate_triggers_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
evaluate_triggers.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
evaluate_valid_test.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
evaluate_valid.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
evaluate.go Introduce separate testing scope for reference validation (#33339) 2023-06-28 09:47:24 +02:00
execute.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
features.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph_builder_apply_test.go update providers.Schemas type 2023-07-06 10:37:35 -04:00
graph_builder_apply.go [Testing Framework] Adds TestContext for evaluating test assertions (#33326) 2023-06-26 17:42:53 +02:00
graph_builder_eval.go Add input validation into the 'checks' outputs and tracking (#33481) 2023-07-10 11:33:45 +01:00
graph_builder_plan_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph_builder_plan.go Add input validation into the 'checks' outputs and tracking (#33481) 2023-07-10 11:33:45 +01:00
graph_builder_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph_builder.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph_dot_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph_dot.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph_interface_subgraph.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph_walk_context.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
graph_walk_operation.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph_walk_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph_walk.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
graph.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
hook_mock.go add import hooks for plan and apply 2023-05-10 20:53:44 -07:00
hook_stop_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
hook_stop.go add import hooks for plan and apply 2023-05-10 20:53:44 -07:00
hook_test.go add import hooks for plan and apply 2023-05-10 20:53:44 -07:00
hook.go add import hooks for plan and apply 2023-05-10 20:53:44 -07:00
instance_expanders.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
marks_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
marks.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_check.go [testing framework] implement expect_failures functionality (#33443) 2023-07-10 11:30:44 +01:00
node_data_destroy_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_data_destroy.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_external_reference.go [Testing Framework] Adds TestContext for evaluating test assertions (#33326) 2023-06-26 17:42:53 +02:00
node_local_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_local.go Introduce separate testing scope for reference validation (#33339) 2023-06-28 09:47:24 +02:00
node_module_expand_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_module_expand.go Introduce separate testing scope for reference validation (#33339) 2023-06-28 09:47:24 +02:00
node_module_variable_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_module_variable.go Add input validation into the 'checks' outputs and tracking (#33481) 2023-07-10 11:33:45 +01:00
node_output_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_output.go always evaluate module outputs during destroy 2023-06-30 15:24:49 -04:00
node_provider_abstract.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_provider_eval.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_provider_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_provider.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_resource_abstract_instance_test.go update providers.Schemas type 2023-07-06 10:37:35 -04:00
node_resource_abstract_instance.go [testing framework] implement expect_failures functionality (#33443) 2023-07-10 11:30:44 +01:00
node_resource_abstract_test.go update providers.Schemas type 2023-07-06 10:37:35 -04:00
node_resource_abstract.go allow interpolation in import block id (#33618) 2023-08-02 10:20:27 +01:00
node_resource_apply_instance.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
node_resource_apply_test.go remove NodeApplyableResource 2023-06-28 13:32:00 -04:00
node_resource_apply.go connect references from config nodes during apply 2023-06-28 13:31:58 -04:00
node_resource_destroy_deposed_test.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
node_resource_destroy_deposed.go update providers.Schemas type 2023-07-06 10:37:35 -04:00
node_resource_destroy.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_resource_import.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_resource_plan_destroy.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_resource_plan_instance.go allow interpolation in import block id (#33618) 2023-08-02 10:20:27 +01:00
node_resource_plan_orphan_test.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
node_resource_plan_orphan.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
node_resource_plan.go allow interpolation in import block id (#33618) 2023-08-02 10:20:27 +01:00
node_resource_validate_test.go update providers.Schemas type 2023-07-06 10:37:35 -04:00
node_resource_validate.go update providers.Schemas type 2023-07-06 10:37:35 -04:00
node_root_variable_test.go Add input validation into the 'checks' outputs and tracking (#33481) 2023-07-10 11:33:45 +01:00
node_root_variable.go Add input validation into the 'checks' outputs and tracking (#33481) 2023-07-10 11:33:45 +01:00
node_value.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
phasestate_string.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
provider_mock.go fix locking and race in test mocks 2023-07-06 11:46:17 -04:00
provisioner_mock_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
provisioner_mock.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
reduce_plan_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
reduce_plan.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
resource_provider_mock_test.go update providers.Schemas type 2023-07-06 10:37:35 -04:00
schemas_test.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
schemas.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
terraform_test.go testing framework: introduce test command optional flags (#33504) 2023-07-19 10:07:46 +02:00
test_context_test.go test framework: fix bug preventing remaining assertions being checked after one has failed (#33601) 2023-08-01 09:56:51 +02:00
test_context.go test framework: fix bug preventing remaining assertions being checked after one has failed (#33601) 2023-08-01 09:56:51 +02:00
transform_attach_config_provider_meta.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_attach_config_provider.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_attach_config_resource.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_attach_schema.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_attach_state.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_check_starter.go Ensure nested data blocks execute last of all Terraform resources (#33301) 2023-06-02 17:35:34 +02:00
transform_check.go fix crash when nested data blocks are mixed with the import command (#33578) 2023-07-26 09:41:00 +02:00
transform_config_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_config.go terraform: expanded resources cannot genconfig (#33293) 2023-05-31 20:25:15 +01:00
transform_destroy_cbd_test.go connect references from config nodes during apply 2023-06-28 13:31:58 -04:00
transform_destroy_cbd.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_destroy_edge_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_destroy_edge.go Merge pull request #33047 from hashicorp/jbardin/destroy-provider-pruning 2023-05-10 11:54:10 -04:00
transform_diff_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_diff.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_expand.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_external_reference.go [Testing Framework] Adds TestContext for evaluating test assertions (#33326) 2023-06-26 17:42:53 +02:00
transform_import_state_test.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
transform_local.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_module_expansion.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_module_variable_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_module_variable.go Add input validation into the 'checks' outputs and tracking (#33481) 2023-07-10 11:33:45 +01:00
transform_orphan_count_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_orphan_count.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_orphan_output.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_orphan_resource_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_orphan_resource.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_output.go destroy locals referenced by root outputs 2023-05-22 13:03:49 -04:00
transform_provider_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_provider.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_provisioner.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_reference_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_reference.go Introduce separate testing scope for reference validation (#33339) 2023-06-28 09:47:24 +02:00
transform_removed_modules.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_resource_count.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_root_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_root.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_state.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_targets_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_targets.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_transitive_reduction_test.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
transform_transitive_reduction.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_variable.go Add input validation into the 'checks' outputs and tracking (#33481) 2023-07-10 11:33:45 +01:00
transform_vertex_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform_vertex.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
transform.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_input_mock.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_input_prefix_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_input_prefix.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_input.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_output_callback_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_output_callback.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_output_mock_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_output_mock.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_output_provisioner_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_output_provisioner.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
ui_output.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
update_state_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
update_state_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
upgrade_resource_state_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
upgrade_resource_state.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
util_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
util.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
validate_selfref_test.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
validate_selfref.go s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
valuesourcetype_string.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
variables_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
variables.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
version_required.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
walkoperation_string.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00