4 "github.com/hashicorp/terraform/plugin/discovery"
7 // Providers describes a set of provider dependencies for a given module.
9 // Each named provider instance can have one version constraint.
10 type Providers map[ProviderInstance]ProviderDependency
12 // ProviderDependency describes the dependency for a particular provider
13 // instance, including both the set of allowed versions and the reason for
15 type ProviderDependency struct {
16 Constraints discovery.Constraints
17 Reason ProviderDependencyReason
20 // ProviderDependencyReason is an enumeration of reasons why a dependency might be
22 type ProviderDependencyReason int
25 // ProviderDependencyExplicit means that there is an explicit "provider"
26 // block in the configuration for this module.
27 ProviderDependencyExplicit ProviderDependencyReason = iota
29 // ProviderDependencyImplicit means that there is no explicit "provider"
30 // block but there is at least one resource that uses this provider.
31 ProviderDependencyImplicit
33 // ProviderDependencyInherited is a special case of
34 // ProviderDependencyImplicit where a parent module has defined a
35 // configuration for the provider that has been inherited by at least one
36 // resource in this module.
37 ProviderDependencyInherited
39 // ProviderDependencyFromState means that this provider is not currently
40 // referenced by configuration at all, but some existing instances in
41 // the state still depend on it.
42 ProviderDependencyFromState