github.com/ns1/terraform@v0.7.10-0.20161109153551-8949419bef40/terraform/node_output_orphan.go (about) 1 package terraform 2 3 import ( 4 "fmt" 5 ) 6 7 // NodeOutputOrphan represents an output that is an orphan. 8 type NodeOutputOrphan struct { 9 OutputName string 10 PathValue []string 11 } 12 13 func (n *NodeOutputOrphan) Name() string { 14 result := fmt.Sprintf("output.%s (orphan)", n.OutputName) 15 if len(n.PathValue) > 1 { 16 result = fmt.Sprintf("%s.%s", modulePrefixStr(n.PathValue), result) 17 } 18 19 return result 20 } 21 22 // GraphNodeSubPath 23 func (n *NodeOutputOrphan) Path() []string { 24 return n.PathValue 25 } 26 27 // GraphNodeEvalable 28 func (n *NodeOutputOrphan) EvalTree() EvalNode { 29 return &EvalDeleteOutput{ 30 Name: n.OutputName, 31 } 32 }