github.com/paultyng/terraform@v0.6.11-0.20180227224804-66ff8f8bed40/moduledeps/dependencies.go (about)

     1  package moduledeps
     2  
     3  import (
     4  	"github.com/hashicorp/terraform/plugin/discovery"
     5  )
     6  
     7  // Providers describes a set of provider dependencies for a given module.
     8  //
     9  // Each named provider instance can have one version constraint.
    10  type Providers map[ProviderInstance]ProviderDependency
    11  
    12  // ProviderDependency describes the dependency for a particular provider
    13  // instance, including both the set of allowed versions and the reason for
    14  // the dependency.
    15  type ProviderDependency struct {
    16  	Constraints discovery.Constraints
    17  	Reason      ProviderDependencyReason
    18  }
    19  
    20  // ProviderDependencyReason is an enumeration of reasons why a dependency might be
    21  // present.
    22  type ProviderDependencyReason int
    23  
    24  const (
    25  	// ProviderDependencyExplicit means that there is an explicit "provider"
    26  	// block in the configuration for this module.
    27  	ProviderDependencyExplicit ProviderDependencyReason = iota
    28  
    29  	// ProviderDependencyImplicit means that there is no explicit "provider"
    30  	// block but there is at least one resource that uses this provider.
    31  	ProviderDependencyImplicit
    32  
    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
    38  
    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
    43  )