4 "github.com/hashicorp/terraform/addrs"
5 "github.com/hashicorp/terraform/configs"
8 // RootVariableTransformer is a GraphTransformer that adds all the root
9 // variables to the graph.
11 // Root variables are currently no-ops but they must be added to the
12 // graph since downstream things that depend on them must be able to
14 type RootVariableTransformer struct {
15 Config *configs.Config
18 func (t *RootVariableTransformer) Transform(g *Graph) error {
19 // We can have no variables if we have no config.
24 // We're only considering root module variables here, since child
25 // module variables are handled by ModuleVariableTransformer.
26 vars := t.Config.Module.Variables
28 // Add all variables here
29 for _, v := range vars {
30 node := &NodeRootVariable{
31 Addr: addrs.InputVariable{