opentofu/internal/moduledeps/dependencies.go
Kuba Martin ebcf7455eb
Rename root module name. (#4)
* Rename module name from "github.com/hashicorp/terraform" to "github.com/placeholderplaceholderplaceholder/opentf".

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Gofmt.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Regenerate protobuf.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix comments.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo issue and pull request link changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo comment changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix comment.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo some link changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* make generate && make protobuf

Signed-off-by: Jakub Martin <kubam@spacelift.io>

---------

Signed-off-by: Jakub Martin <kubam@spacelift.io>
2023-08-17 14:45:11 +02:00

48 lines
1.6 KiB
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package moduledeps
import (
"github.com/placeholderplaceholderplaceholder/opentf/internal/addrs"
"github.com/placeholderplaceholderplaceholder/opentf/internal/plugin/discovery"
)
// Providers describes a set of provider dependencies for a given module.
//
// Each named provider instance can have one version constraint.
type Providers map[addrs.Provider]ProviderDependency
// ProviderDependency describes the dependency for a particular provider
// instance, including both the set of allowed versions and the reason for
// the dependency.
type ProviderDependency struct {
Constraints discovery.Constraints
Reason ProviderDependencyReason
}
// ProviderDependencyReason is an enumeration of reasons why a dependency might be
// present.
type ProviderDependencyReason int
const (
// ProviderDependencyExplicit means that there is an explicit "provider"
// block in the configuration for this module.
ProviderDependencyExplicit ProviderDependencyReason = iota
// ProviderDependencyImplicit means that there is no explicit "provider"
// block but there is at least one resource that uses this provider.
ProviderDependencyImplicit
// ProviderDependencyInherited is a special case of
// ProviderDependencyImplicit where a parent module has defined a
// configuration for the provider that has been inherited by at least one
// resource in this module.
ProviderDependencyInherited
// ProviderDependencyFromState means that this provider is not currently
// referenced by configuration at all, but some existing instances in
// the state still depend on it.
ProviderDependencyFromState
)