2015-01-21 23:39:16 +01:00
|
|
|
package terraform
|
|
|
|
|
|
|
|
import (
|
2015-01-23 02:12:32 +01:00
|
|
|
"github.com/hashicorp/terraform/dag"
|
2015-01-21 23:39:16 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// graphNodeConfig is an interface that all graph nodes for the
|
|
|
|
// configuration graph need to implement in order to build the variable
|
|
|
|
// dependencies properly.
|
|
|
|
type graphNodeConfig interface {
|
2015-01-24 00:21:27 +01:00
|
|
|
dag.NamedVertex
|
2015-01-21 23:39:16 +01:00
|
|
|
|
2015-01-27 23:56:01 +01:00
|
|
|
// All graph nodes should be dependent on other things, and able to
|
|
|
|
// be depended on.
|
|
|
|
GraphNodeDependable
|
|
|
|
GraphNodeDependent
|
2015-04-09 06:14:19 +02:00
|
|
|
|
|
|
|
// ConfigType returns the type of thing in the configuration that
|
|
|
|
// this node represents, such as a resource, module, etc.
|
|
|
|
ConfigType() GraphNodeConfigType
|
2015-01-21 23:39:16 +01:00
|
|
|
}
|
|
|
|
|
2015-03-31 02:02:36 +02:00
|
|
|
// GraphNodeAddressable is an interface that all graph nodes for the
|
|
|
|
// configuration graph need to implement in order to be be addressed / targeted
|
|
|
|
// properly.
|
|
|
|
type GraphNodeAddressable interface {
|
|
|
|
graphNodeConfig
|
|
|
|
|
|
|
|
ResourceAddress() *ResourceAddress
|
|
|
|
}
|
|
|
|
|
|
|
|
// GraphNodeTargetable is an interface for graph nodes to implement when they
|
|
|
|
// need to be told about incoming targets. This is useful for nodes that need
|
|
|
|
// to respect targets as they dynamically expand. Note that the list of targets
|
|
|
|
// provided will contain every target provided, and each implementing graph
|
|
|
|
// node must filter this list to targets considered relevant.
|
|
|
|
type GraphNodeTargetable interface {
|
|
|
|
GraphNodeAddressable
|
|
|
|
|
|
|
|
SetTargets([]ResourceAddress)
|
|
|
|
}
|