8 // ImportProviderValidateTransformer is a GraphTransformer that goes through
9 // the providers in the graph and validates that they only depend on variables.
10 type ImportProviderValidateTransformer struct{}
12 func (t *ImportProviderValidateTransformer) Transform(g *Graph) error {
13 for _, v := range g.Vertices() {
14 // We only care about providers
15 pv, ok := v.(GraphNodeProvider)
20 // We only care about providers that reference things
21 rn, ok := pv.(GraphNodeReferencer)
26 for _, ref := range rn.References() {
27 if !strings.HasPrefix(ref, "var.") {
29 "Provider %q depends on non-var %q. Providers for import can currently\n"+
30 "only depend on variables or must be hardcoded. You can stop import\n"+
31 "from loading configurations by specifying `-config=\"\"`.",
32 pv.ProviderName(), ref)