github.com/gettyimages/terraform@v0.7.6-0.20161219132226-dc052c5707a3/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 &EvalOpFilter{ 30 Ops: []walkOperation{walkRefresh, walkApply, walkDestroy}, 31 Node: &EvalDeleteOutput{ 32 Name: n.OutputName, 33 }, 34 } 35 }