github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/terraform/node_module_destroy.go (about)

     1  package terraform
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // NodeDestroyableModule represents a module destruction.
     8  type NodeDestroyableModuleVariable struct {
     9  	PathValue []string
    10  }
    11  
    12  func (n *NodeDestroyableModuleVariable) Name() string {
    13  	result := "plan-destroy"
    14  	if len(n.PathValue) > 1 {
    15  		result = fmt.Sprintf("%s.%s", modulePrefixStr(n.PathValue), result)
    16  	}
    17  
    18  	return result
    19  }
    20  
    21  // GraphNodeSubPath
    22  func (n *NodeDestroyableModuleVariable) Path() []string {
    23  	return n.PathValue
    24  }
    25  
    26  // GraphNodeEvalable
    27  func (n *NodeDestroyableModuleVariable) EvalTree() EvalNode {
    28  	return &EvalDiffDestroyModule{Path: n.PathValue}
    29  }