summaryrefslogtreecommitdiff
path: root/vendor/github.com/hashicorp/terraform/terraform/node_root_variable.go
blob: cb61a4e3a67263dbbb2e346bd415980c69113390 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package terraform

import (
	"fmt"

	"github.com/hashicorp/terraform/config"
)

// NodeRootVariable represents a root variable input.
type NodeRootVariable struct {
	Config *config.Variable
}

func (n *NodeRootVariable) Name() string {
	result := fmt.Sprintf("var.%s", n.Config.Name)
	return result
}

// GraphNodeReferenceable
func (n *NodeRootVariable) ReferenceableName() []string {
	return []string{n.Name()}
}