7 "github.com/hashicorp/terraform/config"
10 // NodeLocal represents a named local value in a particular module.
12 // Local value nodes only have one operation, common to all walk types:
13 // evaluate the result and place it in state.
14 type NodeLocal struct {
19 func (n *NodeLocal) Name() string {
20 result := fmt.Sprintf("local.%s", n.Config.Name)
21 if len(n.PathValue) > 1 {
22 result = fmt.Sprintf("%s.%s", modulePrefixStr(n.PathValue), result)
29 func (n *NodeLocal) Path() []string {
33 // RemovableIfNotTargeted
34 func (n *NodeLocal) RemoveIfNotTargeted() bool {
38 // GraphNodeReferenceable
39 func (n *NodeLocal) ReferenceableName() []string {
40 name := fmt.Sprintf("local.%s", n.Config.Name)
44 // GraphNodeReferencer
45 func (n *NodeLocal) References() []string {
47 result = append(result, ReferencesFromConfig(n.Config.RawConfig)...)
48 for _, v := range result {
49 split := strings.Split(v, "/")
50 for i, s := range split {
51 split[i] = s + ".destroy"
54 result = append(result, strings.Join(split, "/"))
61 func (n *NodeLocal) EvalTree() EvalNode {
64 Value: n.Config.RawConfig,