func (n *NodeAbstractResource) ResourceAddress() *ResourceAddress {
	return n.ResourceAddr()
}
GraphNodeAddressable, TODO: remove, used by target, should unify
package terraform
import (
	"fmt"
	"strings"
	"github.com/hashicorp/terraform/config"
	"github.com/hashicorp/terraform/dag"
)
type ConcreteResourceNodeFunc func(*NodeAbstractResource) dag.Vertex
type GraphNodeResource interface {
	ResourceAddr() *ResourceAddress
}
type NodeAbstractResource struct {
	Addr *ResourceAddress  
	Config        *config.Resource  
	ResourceState *ResourceState    
	Targets []ResourceAddress  
}
func (n *NodeAbstractResource) Name() string {
	return n.Addr.String()
}
func (n *NodeAbstractResource) Path() []string {
	return n.Addr.Path
}
func (n *NodeAbstractResource) ReferenceableName() []string {
	var id string
	if n.Config != nil {
		id = n.Config.Id()
	} else if n.Addr != nil {
		addrCopy := n.Addr.Copy()
		addrCopy.Path = nil  
		addrCopy.Index = -1  
		id = addrCopy.String()
	} else {
		return nil
	}
	var result []string
	result = append(result, id)
	result = append(result, fmt.Sprintf("%s.*", id))
	suffix := "N"
	if n.Addr != nil {
		idx := n.Addr.Index
		if idx == -1 {
			idx = 0
		}
		suffix = fmt.Sprintf("%d", idx)
	}
	result = append(result, fmt.Sprintf("%s.%s", id, suffix))
	return result
}
func (n *NodeAbstractResource) References() []string {
	if c := n.Config; c != nil {
		var result []string
		result = append(result, c.DependsOn...)
		result = append(result, ReferencesFromConfig(c.RawCount)...)
		result = append(result, ReferencesFromConfig(c.RawConfig)...)
		for _, p := range c.Provisioners {
			if p.When == config.ProvisionerWhenCreate {
				result = append(result, ReferencesFromConfig(p.ConnInfo)...)
				result = append(result, ReferencesFromConfig(p.RawConfig)...)
			}
		}
		return result
	}
	if s := n.ResourceState; s != nil {
		return s.Dependencies
	}
	return nil
}
func (n *NodeAbstractResource) StateReferences() []string {
	self := n.ReferenceableName()
	addrCopy := n.Addr.Copy()
	addrCopy.Index = -1
	selfPrefix := addrCopy.String() + "."
	depsRaw := n.References()
	deps := make([]string, 0, len(depsRaw))
	for _, d := range depsRaw {
		if strings.HasPrefix(d, "var.") {
			continue
		}
		if idx := strings.IndexRune(d, '/'); idx != -1 {
			d = d[:idx]
		}
		found := false
		for _, s := range self {
			if d == s {
				found = true
			}
		}
		if found {
			continue
		}
		if strings.HasSuffix(d, ".0") && !strings.HasPrefix(d, selfPrefix) {
			d = d[:len(d)-2]
		}
		if strings.HasPrefix(d, "module.") {
			parts := strings.SplitN(d, ".", 3)
			d = strings.Join(parts[0:2], ".")
		}
		deps = append(deps, d)
	}
	return deps
}
func (n *NodeAbstractResource) ProvidedBy() []string {
	if n.Config != nil {
		return []string{resourceProvider(n.Config.Type, n.Config.Provider)}
	}
	if n.ResourceState != nil && n.ResourceState.Provider != "" {
		return []string{n.ResourceState.Provider}
	}
	return []string{resourceProvider(n.Addr.Type, "")}
}
func (n *NodeAbstractResource) ProvisionedBy() []string {
	if n.Config == nil {
		return nil
	}
	result := make([]string, len(n.Config.Provisioners))
	for i, p := range n.Config.Provisioners {
		result[i] = p.Type
	}
	return result
}
func (n *NodeAbstractResource) ResourceAddr() *ResourceAddress {
	return n.Addr
}