diff --git a/terraform/graph_config_node_resource.go b/terraform/graph_config_node_resource.go index 8b09524a2..751652f71 100644 --- a/terraform/graph_config_node_resource.go +++ b/terraform/graph_config_node_resource.go @@ -229,22 +229,6 @@ func (n *GraphNodeConfigResource) ProvisionedBy() []string { return result } -// GraphNodeDestroyable -func (n *GraphNodeConfigResource) DestroyNode() GraphNodeDestroy { - // If we're already a destroy node, then don't do anything - if n.Destroy { - return nil - } - - result := &graphNodeResourceDestroy{ - GraphNodeConfigResource: *n.Copy(), - Original: n, - } - result.Destroy = true - - return result -} - // Same as GraphNodeConfigResource, but for flattening type GraphNodeConfigResourceFlat struct { *GraphNodeConfigResource @@ -288,27 +272,6 @@ func (n *GraphNodeConfigResourceFlat) ProvisionedBy() []string { prefix) } -// GraphNodeDestroyable impl. -func (n *GraphNodeConfigResourceFlat) DestroyNode() GraphNodeDestroy { - // Get our parent destroy node. If we don't have any, just return - raw := n.GraphNodeConfigResource.DestroyNode() - if raw == nil { - return nil - } - - node, ok := raw.(*graphNodeResourceDestroy) - if !ok { - panic(fmt.Sprintf("unknown destroy node: %s %T", dag.VertexName(raw), raw)) - } - - // Otherwise, wrap it so that it gets the proper module treatment. - return &graphNodeResourceDestroyFlat{ - graphNodeResourceDestroy: node, - PathValue: n.PathValue, - FlatCreateNode: n, - } -} - type graphNodeResourceDestroyFlat struct { *graphNodeResourceDestroy diff --git a/terraform/transform_destroy.go b/terraform/transform_destroy.go deleted file mode 100644 index 45eaae133..000000000 --- a/terraform/transform_destroy.go +++ /dev/null @@ -1,20 +0,0 @@ -package terraform - -import ( - "github.com/hashicorp/terraform/dag" -) - -// GraphNodeDestroy is the interface that must implemented by -// nodes that destroy. -type GraphNodeDestroy interface { - dag.Vertex - - // CreateBeforeDestroy is called to check whether this node - // should be created before it is destroyed. The CreateBeforeDestroy - // transformer uses this information to setup the graph. - CreateBeforeDestroy() bool - - // CreateNode returns the node used for the create side of this - // destroy. This must already exist within the graph. - CreateNode() dag.Vertex -}