Documentation
¶
Overview ¶
Package install finds provider plugins that OpenTofu or Terraform already downloaded, and asks them to download missing ones.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoBinary = errors.New("neither tofu nor terraform was found in PATH; install OpenTofu (https://opentofu.org) or pass --tf-binary")
ErrNoBinary means neither tofu nor terraform could be found.
var KnownSources = map[string]string{
"alicloud": "aliyun/alicloud",
"auth0": "auth0/auth0",
"aws": "hashicorp/aws",
"azuread": "hashicorp/azuread",
"azuredevops": "microsoft/azuredevops",
"azurerm": "hashicorp/azurerm",
"cloudflare": "cloudflare/cloudflare",
"commercetools": "labd/commercetools",
"datadog": "DataDog/datadog",
"digitalocean": "digitalocean/digitalocean",
"fastly": "fastly/fastly",
"github": "integrations/github",
"gitlab": "gitlabhq/gitlab",
"gmailfilter": "yamamoto-febc/gmailfilter",
"google": "hashicorp/google",
"google-beta": "hashicorp/google-beta",
"grafana": "grafana/grafana",
"heroku": "heroku/heroku",
"honeycombio": "honeycombio/honeycombio",
"ibm": "IBM-Cloud/ibm",
"ionoscloud": "ionos-cloud/ionoscloud",
"keycloak": "keycloak/keycloak",
"kubernetes": "hashicorp/kubernetes",
"launchdarkly": "launchdarkly/launchdarkly",
"linode": "linode/linode",
"logzio": "logzio/logzio",
"mackerel": "mackerelio-labs/mackerel",
"metal": "equinix/metal",
"mikrotik": "ddelnano/mikrotik",
"myrasec": "Myra-Security-GmbH/myrasec",
"newrelic": "newrelic/newrelic",
"ns1": "ns1-terraform/ns1",
"octopusdeploy": "OctopusDeployLabs/octopusdeploy",
"okta": "okta/okta",
"opal": "opalsecurity/opal",
"openstack": "terraform-provider-openstack/openstack",
"opsgenie": "opsgenie/opsgenie",
"pagerduty": "PagerDuty/pagerduty",
"panos": "PaloAltoNetworks/panos",
"rabbitmq": "cyrilgdn/rabbitmq",
"tencentcloud": "tencentcloudstack/tencentcloud",
"vault": "hashicorp/vault",
"vultr": "vultr/vultr",
"xenorchestra": "vatesfr/xenorchestra",
"yandex": "registry.terraform.io/yandex-cloud/yandex",
}
KnownSources maps the provider names used in resource type prefixes to their registry addresses. Terraformer wrote most of these providers into required_providers without a source, which silently meant hashicorp/<name> and broke `init` for every provider not published by HashiCorp.
var Registries = []string{"registry.opentofu.org", "registry.terraform.io"}
Registries are searched in this order. OpenTofu comes first because its registry mirrors almost every provider and needs no account.
Functions ¶
func SearchDirs ¶
func SearchDirs() []string
SearchDirs lists the directories that may hold unpacked providers, most specific first: the current working directory's .terraform, the plugin cache, then the per-user plugin directories.
Types ¶
type Installer ¶
type Installer struct {
// Binary is the tofu or terraform executable. Empty means look for tofu,
// then terraform, in PATH.
Binary string
// CacheDir holds one working directory per provider.
CacheDir string
}
Installer downloads providers with the tofu or terraform binary, so that checksums, mirrors and credentials work exactly as the user configured.
func (*Installer) Ensure ¶
Ensure returns an installed provider, running `init` in a private working directory when it is not installed yet. constraint may be empty.
func (*Installer) FindBinary ¶
FindBinary returns the tofu or terraform executable to use.
type Source ¶
Source is the registry address of a provider. Host is empty for the default registry of whichever tool installs the provider.
func ParseSource ¶
ParseSource accepts "type", "namespace/type" or "host/namespace/type". A bare type means the hashicorp namespace, as in required_providers.