terraform/terraform
James Bardin f766bb8380 prune unused resources from apply
If a resource is only destroying instances, there is no reason to
prepare the state and we can remove the Resource (prepare state) nodes.
They normally have pose no issue, but if the instances are being
destroyed along with their dependencies, the resource node may fail to
evaluate due to the missing dependencies (since destroy happens in the
reverse order).

These failures were previously blocked by there being a cycle when the
destroy nodes were directly attached to the resource nodes.
2019-10-24 12:04:46 -04:00
..
testdata failing test with destroy cycle 2019-10-24 12:04:46 -04:00
context.go backend/local: Handle interactive prompts for variables in UI layer 2019-10-10 10:07:01 -07:00
context_apply_test.go failing test with destroy cycle 2019-10-24 12:04:46 -04:00
context_components.go update to start a new process for each plugin 2018-10-16 19:14:11 -07:00
context_components_test.go replace provider and provisioner types in tests 2018-10-16 19:11:09 -07:00
context_fixtures_test.go Standardise directory name for test data 2019-06-30 10:16:15 +02:00
context_graph_type.go Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
context_import.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
context_import_test.go add implied providers during import 2018-12-04 16:04:19 -05:00
context_input.go backend/local: Handle interactive prompts for variables in UI layer 2019-10-10 10:07:01 -07:00
context_input_test.go backend/local: Handle interactive prompts for variables in UI layer 2019-10-10 10:07:01 -07:00
context_plan_test.go core: Require variables correctly set during NewContext 2019-10-10 10:07:01 -07:00
context_refresh_test.go ensure data sources are always written to state 2019-09-24 17:47:01 -04:00
context_test.go prune references to config/module 2019-08-07 17:50:59 -04:00
context_validate_test.go core: Require variables correctly set during NewContext 2019-10-10 10:07:01 -07:00
diff.go prevent panics when encountering nil diffs 2019-09-04 16:51:42 -04:00
diff_test.go re-count the flatmapped containers 2018-11-16 15:26:16 -05:00
edge_destroy.go
eval.go core: EvalSequence must continue when only warnings are returned 2018-10-16 18:49:20 -07:00
eval_apply.go Merge pull request #22846 from hashicorp/jbardin/evaluate-resource 2019-10-08 07:57:15 -04:00
eval_check_prevent_destroy.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_context.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_context_builtin.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_context_builtin_test.go terraform: More wiring in of new provider types 2018-10-16 19:12:54 -07:00
eval_context_mock.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_count.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_count_boundary.go core: Update EvalCountFixZeroOneBoundaryGlobal for new state types 2018-10-16 19:14:11 -07:00
eval_diff.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_diff_test.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_error.go
eval_filter.go
eval_filter_operation.go
eval_for_each.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_if.go
eval_import_state.go terraform: More wiring in of new provider types 2018-10-16 19:12:54 -07:00
eval_lang.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_local.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_local_test.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_noop.go
eval_output.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_output_test.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
eval_provider.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_provider_test.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_provisioner.go ResourceProvisioner to provisioners.Interface 2018-10-16 19:11:09 -07:00
eval_provisioner_test.go replace provider and provisioner types in tests 2018-10-16 19:11:09 -07:00
eval_read_data.go Resource for_each 2019-07-22 10:51:16 -04:00
eval_refresh.go send and receive Private through ReadResource 2019-06-03 18:08:26 -04:00
eval_sequence.go core: EvalSequence to handle EvalEarlyExitError 2018-10-16 18:49:20 -07:00
eval_sequence_test.go
eval_state.go Add support for for_each for data blocks. 2019-07-25 16:59:06 -04:00
eval_state_test.go export MustShimLegacyState for resource tests 2018-10-16 19:14:11 -07:00
eval_state_upgrade.go core: Call providers' UpgradeResourceState every time 2019-05-14 13:30:42 -04:00
eval_test.go
eval_validate.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_validate_selfref.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_validate_selfref_test.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_validate_test.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
eval_variable.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
evaltree_provider.go first step in core provider type replacement 2018-10-16 19:11:09 -07:00
evaluate.go Tweak the message mildly 2019-10-23 11:18:10 -04:00
evaluate_test.go core: path.module, path.root, path.cwd use fwd slashes on all platforms 2018-12-19 13:47:42 -08:00
evaluate_valid.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
evaluate_valid_test.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
features.go
graph.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
graph_builder.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
graph_builder_apply.go fix CBD tests to work on real data 2019-10-24 12:01:50 -04:00
graph_builder_apply_test.go do not connect destroy and resource nodes 2019-10-24 12:04:46 -04:00
graph_builder_destroy_plan.go core: A "go fmt" catchup 2018-10-16 19:14:11 -07:00
graph_builder_eval.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
graph_builder_import.go command/import: fix error during import when implied provider was not used (#22855) 2019-09-20 10:02:42 -04:00
graph_builder_plan.go core: A "go fmt" catchup 2018-10-16 19:14:11 -07:00
graph_builder_plan_test.go Cover empty sets 2019-09-10 10:57:35 -04:00
graph_builder_refresh.go core: A "go fmt" catchup 2018-10-16 19:14:11 -07:00
graph_builder_refresh_test.go export MustShimLegacyState for resource tests 2018-10-16 19:14:11 -07:00
graph_builder_test.go core: Get tests compiling again 2018-10-16 18:46:46 -07:00
graph_builder_validate.go terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00
graph_dot.go
graph_dot_test.go
graph_interface_subgraph.go terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00
graph_test.go update some graph builder tests 2018-10-16 19:14:11 -07:00
graph_walk.go core: Remove GraphWalkerPanicwrap, etc 2018-10-16 18:48:28 -07:00
graph_walk_context.go core: Evaluate resource references from plan where possible 2018-10-16 19:14:11 -07:00
graph_walk_operation.go Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
graph_walk_test.go
graphtype_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
hook.go terraform: More wiring in of new provider types 2018-10-16 19:12:54 -07:00
hook_mock.go terraform: More wiring in of new provider types 2018-10-16 19:12:54 -07:00
hook_stop.go command: Fix TestPlan_shutdown 2018-11-08 08:57:11 -08:00
hook_stop_test.go
hook_test.go core: Fix various compile-time errors in tests 2018-10-16 19:14:11 -07:00
instancetype.go Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
instancetype_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
module_dependencies.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
module_dependencies_test.go Standardise directory name for test data 2019-06-30 10:16:15 +02:00
node_count_boundary.go core: Update EvalCountFixZeroOneBoundaryGlobal for new state types 2018-10-16 19:14:11 -07:00
node_data_destroy.go rename NodeDestroyableDataResourceInstance 2018-12-18 13:22:21 -05:00
node_data_refresh.go ensure data sources are always written to state 2019-09-24 17:47:01 -04:00
node_data_refresh_test.go rename NodeDestroyableDataResourceInstance 2018-12-18 13:22:21 -05:00
node_local.go core: Local and output values must reference destroy nodes too 2018-10-16 18:49:20 -07:00
node_module_removed.go NodeModuleRemoved implements RemovableIfNotTargeted 2019-09-16 08:47:22 -07:00
node_module_variable.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
node_module_variable_test.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
node_output.go core: Remove machinery for the "input" walk 2018-10-16 18:49:20 -07:00
node_output_orphan.go terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00
node_provider.go
node_provider_abstract.go core: A "go fmt" catchup 2018-10-16 19:14:11 -07:00
node_provider_disabled.go terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00
node_provider_eval.go core: Context.Eval method 2018-10-16 18:46:46 -07:00
node_provisioner.go prune references to config/module 2019-08-07 17:50:59 -04:00
node_resource_abstract.go Resource for_each 2019-07-22 10:51:16 -04:00
node_resource_apply.go core: NodeApplyableResource only depends on count and for_each 2018-10-16 19:14:11 -07:00
node_resource_apply_instance.go Resource for_each 2019-07-22 10:51:16 -04:00
node_resource_destroy.go core: Clean up resource states when they are orphaned 2018-10-16 19:14:11 -07:00
node_resource_destroy_deposed.go core: NodePlanDeposedResourceInstanceObject populate EvalReadStateDeposed 2018-11-30 11:22:39 -08:00
node_resource_plan.go Resource for_each 2019-07-22 10:51:16 -04:00
node_resource_plan_destroy.go core: Always set ProviderAddr on EvalDiffDestroy 2018-10-16 19:14:11 -07:00
node_resource_plan_instance.go Resource for_each 2019-07-22 10:51:16 -04:00
node_resource_plan_orphan.go core: Record correct provider address in orphan destroy plan 2018-10-16 19:14:11 -07:00
node_resource_refresh.go Resource for_each 2019-07-22 10:51:16 -04:00
node_resource_refresh_test.go export MustShimLegacyState for resource tests 2018-10-16 19:14:11 -07:00
node_resource_validate.go Support using self in the provisioner of resources that use for_each 2019-07-29 01:18:33 -06:00
node_root_variable.go core: render variables, locals and outputs nicely in "terraform graph" 2018-10-16 18:46:46 -07:00
plan.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
provider_mock.go move hcl2shim package to configs 2019-08-06 19:58:58 -04:00
provisioner_mock.go fix provisioner tests 2018-12-19 16:02:56 -05:00
resource.go move hcl2shim package to configs 2019-08-06 19:58:58 -04:00
resource_address.go prune references to config/module 2019-08-07 17:50:59 -04:00
resource_address_test.go prune references to config/module 2019-08-07 17:50:59 -04:00
resource_mode.go Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
resource_mode_string.go prune references to config/module 2019-08-07 17:50:59 -04:00
resource_provider.go remove unused ResourceProviderError 2019-02-20 14:23:56 -05:00
resource_provider_mock.go
resource_provider_mock_test.go terraform: More wiring in of new provider types 2018-10-16 19:12:54 -07:00
resource_provisioner.go provisioners: Add Factory type and FactoryFixed helper 2018-10-16 19:14:11 -07:00
resource_provisioner_mock.go move "configschema" from "config" to "configs" 2018-10-16 18:50:29 -07:00
resource_provisioner_mock_test.go replace provider and provisioner types in tests 2018-10-16 19:11:09 -07:00
resource_test.go move hcl2shim package to configs 2019-08-06 19:58:58 -04:00
schemas.go core: Automatically upgrade resource instance states on read 2018-11-30 11:22:39 -08:00
schemas_test.go terraform.Schemas: export struct fields 2018-10-16 19:14:11 -07:00
state.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
state_filter.go restore (via copypaste) terraform.State.Remove 2019-01-03 22:06:30 -05:00
state_test.go prune references to config/module 2019-08-07 17:50:59 -04:00
state_upgrade_v1_to_v2.go
state_upgrade_v2_to_v3.go
state_v1.go
terraform_test.go Move things around, add test for resource references 2019-08-28 14:02:11 -04:00
testing.go
transform.go terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00
transform_attach_config_provider.go core: Attach resource and provider config schemas during graph build 2018-10-16 18:46:46 -07:00
transform_attach_config_resource.go core: Additional trace logging in attach resource config transformer 2018-10-16 18:48:28 -07:00
transform_attach_schema.go core: Make resource type schema versions visible to callers 2018-11-27 15:53:54 -08:00
transform_attach_state.go attach a deep copy of ResourceState 2018-12-17 18:08:53 -05:00
transform_config.go terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00
transform_config_test.go core: Get tests compiling again 2018-10-16 18:46:46 -07:00
transform_count_boundary.go core: Update EvalCountFixZeroOneBoundaryGlobal for new state types 2018-10-16 19:14:11 -07:00
transform_destroy_cbd.go fix CBD tests to work on real data 2019-10-24 12:01:50 -04:00
transform_destroy_cbd_test.go fix CBD tests to work on real data 2019-10-24 12:01:50 -04:00
transform_destroy_edge.go prune unused resources from apply 2019-10-24 12:04:46 -04:00
transform_destroy_edge_test.go core: Fetch schemas during context construction 2018-10-16 18:49:20 -07:00
transform_diff.go do not connect destroy and resource nodes 2019-10-24 12:04:46 -04:00
transform_diff_test.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
transform_expand.go
transform_expand_test.go
transform_import_provider.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
transform_import_state.go add implied providers during import 2018-12-04 16:04:19 -05:00
transform_local.go terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00
transform_module_variable.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
transform_module_variable_test.go core: Get tests compiling again 2018-10-16 18:46:46 -07:00
transform_orphan_count.go Reordering, comment update 2019-08-13 17:22:14 -04:00
transform_orphan_count_test.go Add test 2019-08-13 16:31:07 -04:00
transform_orphan_output.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
transform_orphan_resource.go core: Clean up resource states when they are orphaned 2018-10-16 19:14:11 -07:00
transform_orphan_resource_test.go core: OrphanResourceTransformer -> OrphanResourceInstanceTransformer 2018-10-16 19:14:11 -07:00
transform_output.go terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00
transform_provider.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
transform_provider_test.go core: Update ProviderTransformer tests for new ImportTarget interface 2018-10-16 18:48:28 -07:00
transform_provisioner.go only create one provisioner instance per type 2019-08-21 19:41:56 -04:00
transform_provisioner_test.go update tests to reflect correct provisioners 2019-08-21 19:41:56 -04:00
transform_reference.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
transform_reference_test.go core: Fix ReferenceTransformer tests 2018-10-16 18:48:28 -07:00
transform_removed_modules.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
transform_resource_count.go Resource for_each 2019-07-22 10:51:16 -04:00
transform_root.go
transform_root_test.go core: NodeAbstractResource correct default result from ProvidedBy 2018-10-16 18:48:28 -07:00
transform_state.go core: Be more explicit in how we handle create_before_destroy 2018-10-16 19:14:11 -07:00
transform_targets.go don't check for targeted downstream from providers 2018-10-16 18:49:20 -07:00
transform_targets_test.go core: Get tests compiling again 2018-10-16 18:46:46 -07:00
transform_transitive_reduction.go
transform_transitive_reduction_test.go terraform.Schemas: export struct fields 2018-10-16 19:14:11 -07:00
transform_variable.go terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00
transform_vertex.go
transform_vertex_test.go
ui_input.go core: add a context to the UIInput interface 2019-03-08 10:24:40 +01:00
ui_input_mock.go core: add a context to the UIInput interface 2019-03-08 10:24:40 +01:00
ui_input_prefix.go core: add a context to the UIInput interface 2019-03-08 10:24:40 +01:00
ui_input_prefix_test.go core: add a context to the UIInput interface 2019-03-08 10:24:40 +01:00
ui_output.go
ui_output_callback.go
ui_output_callback_test.go
ui_output_mock.go
ui_output_mock_test.go
ui_output_provisioner.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
ui_output_provisioner_test.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
upgrade_state_v1_test.go
upgrade_state_v2_test.go
user_agent.go httpclient: Introduce composable UserAgent() 2019-08-05 11:07:21 +01:00
util.go prune ResourceProviderFullName and its callers 2019-07-18 15:24:34 -04:00
util_test.go
valuesourcetype_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
variables.go Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
variables_test.go Standardise directory name for test data 2019-06-30 10:16:15 +02:00
version.go httpclient: Introduce composable UserAgent() 2019-08-05 11:07:21 +01:00
version_required.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
walkoperation_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00