2016-09-18 23:45:19 -05:00
|
|
|
package terraform
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
// NodeOutputOrphan represents an output that is an orphan.
|
|
|
|
type NodeOutputOrphan struct {
|
|
|
|
OutputName string
|
|
|
|
PathValue []string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *NodeOutputOrphan) Name() string {
|
|
|
|
result := fmt.Sprintf("output.%s (orphan)", n.OutputName)
|
|
|
|
if len(n.PathValue) > 1 {
|
|
|
|
result = fmt.Sprintf("%s.%s", modulePrefixStr(n.PathValue), result)
|
|
|
|
}
|
|
|
|
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
2017-11-09 09:52:46 -06:00
|
|
|
// GraphNodeReferenceable
|
|
|
|
func (n *NodeOutputOrphan) ReferenceableName() []string {
|
|
|
|
return []string{"output." + n.OutputName}
|
|
|
|
}
|
|
|
|
|
2016-09-18 23:45:19 -05:00
|
|
|
// GraphNodeSubPath
|
|
|
|
func (n *NodeOutputOrphan) Path() []string {
|
|
|
|
return n.PathValue
|
|
|
|
}
|
|
|
|
|
|
|
|
// GraphNodeEvalable
|
|
|
|
func (n *NodeOutputOrphan) EvalTree() EvalNode {
|
2016-11-08 15:21:50 -06:00
|
|
|
return &EvalOpFilter{
|
|
|
|
Ops: []walkOperation{walkRefresh, walkApply, walkDestroy},
|
|
|
|
Node: &EvalDeleteOutput{
|
|
|
|
Name: n.OutputName,
|
|
|
|
},
|
2016-09-18 23:45:19 -05:00
|
|
|
}
|
|
|
|
}
|