]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blame - vendor/github.com/hashicorp/terraform/terraform/node_output_orphan.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / terraform / node_output_orphan.go
CommitLineData
bae9f6d2
JC
1package terraform
2
3import (
4 "fmt"
107c1cdb
ND
5
6 "github.com/hashicorp/terraform/addrs"
bae9f6d2
JC
7)
8
9// NodeOutputOrphan represents an output that is an orphan.
10type NodeOutputOrphan struct {
107c1cdb 11 Addr addrs.AbsOutputValue
bae9f6d2
JC
12}
13
107c1cdb
ND
14var (
15 _ GraphNodeSubPath = (*NodeOutputOrphan)(nil)
16 _ GraphNodeReferenceable = (*NodeOutputOrphan)(nil)
17 _ GraphNodeReferenceOutside = (*NodeOutputOrphan)(nil)
18 _ GraphNodeEvalable = (*NodeOutputOrphan)(nil)
19)
20
bae9f6d2 21func (n *NodeOutputOrphan) Name() string {
107c1cdb
ND
22 return fmt.Sprintf("%s (orphan)", n.Addr.String())
23}
bae9f6d2 24
107c1cdb
ND
25// GraphNodeReferenceOutside implementation
26func (n *NodeOutputOrphan) ReferenceOutside() (selfPath, referencePath addrs.ModuleInstance) {
27 return referenceOutsideForOutput(n.Addr)
bae9f6d2
JC
28}
29
15c0b25d 30// GraphNodeReferenceable
107c1cdb
ND
31func (n *NodeOutputOrphan) ReferenceableAddrs() []addrs.Referenceable {
32 return referenceableAddrsForOutput(n.Addr)
15c0b25d
AP
33}
34
bae9f6d2 35// GraphNodeSubPath
107c1cdb
ND
36func (n *NodeOutputOrphan) Path() addrs.ModuleInstance {
37 return n.Addr.Module
bae9f6d2
JC
38}
39
40// GraphNodeEvalable
41func (n *NodeOutputOrphan) EvalTree() EvalNode {
42 return &EvalOpFilter{
43 Ops: []walkOperation{walkRefresh, walkApply, walkDestroy},
44 Node: &EvalDeleteOutput{
107c1cdb 45 Addr: n.Addr.OutputValue,
bae9f6d2
JC
46 },
47 }
48}