terraform-providers
Inspect and manage Terraform provider requirements
TLDR
SYNOPSIS
terraform providers [options]terraform providers lock [options] [providers...]terraform providers mirror [options] target-dirterraform providers schema -json [options]
DESCRIPTION
terraform providers reports the provider requirements of the configuration in the current working directory, showing where each requirement comes from. Providers are plugins that talk to remote APIs (AWS, Azure, Kubernetes, and many others) and also some local-only helpers.The default output is a tree of the root module, child modules, and tests, annotated with provider source addresses and version constraints. A second section lists providers still required by the current state, which can include plugins for resources that have been removed from configuration but not yet destroyed.Provider dependencies appear when a configuration declares a required_providers or provider block, when it uses a resource or data source belonging to a provider, or when state still contains instances of that provider. Run this command after terraform init to confirm which plugins the working directory actually selected.Subcommands cover the rest of the plugin lifecycle. terraform providers lock consults origin registries (or a mirror) and writes version selections plus signed checksums into .terraform.lock.hcl, which is the usual way to pre-populate hashes for every platform a team uses. terraform providers mirror copies those packages into a directory that air-gapped machines can later use as a filesystem or network mirror. terraform providers schema -json dumps resource, data source, ephemeral resource, and function schemas for tooling.
PARAMETERS
-var 'NAME=VALUE'
Set a single root-module input variable. May be repeated.-var-file FILENAME
Load variable values from a .tfvars file. May be repeated.lock
Write selected provider versions and package checksums into .terraform.lock.hcl without installing the plugins into the working directory.-platform OSARCH_
Target platform for lock or mirror (for example linux_amd64, darwin_arm64, windows_amd64). Repeat to cover several systems.-fs-mirror PATH
For lock: read provider packages from a local filesystem mirror instead of origin registries.-net-mirror URL
For lock: read provider packages from a network mirror instead of origin registries.-enable-plugin-cache
For lock: use the globally configured plugin cache. Off by default because the cache is not an authoritative source.mirror
Download required provider packages into target-dir using the filesystem-mirror layout (and JSON indexes for the network-mirror protocol).-lock-file true|false
For mirror: honour .terraform.lock.hcl when choosing versions. Default is true.schema
Print detailed schemas for every provider used in the configuration. -json is required.
INSTALL
CAVEATS
terraform providers lock prints signing information but does not decide whether a provider is trustworthy. Review the reported keys before committing an updated lock file.Lock entries built with -fs-mirror or -net-mirror record only the checksums the mirror reports, and only for the platforms you requested. Official signed checksums come from origin registries.terraform providers schema requires -json; there is no human-readable schema dump. The working directory must already be initialized so provider plugins are installed.terraform providers mirror is available in Terraform 0.13 and later. Re-running it on an existing directory adds new platforms without deleting packages already present.
HISTORY
Terraform was created by Mitchell Hashimoto and released by HashiCorp in 2014. Automatic provider installation and the public Terraform Registry became the default in Terraform 0.13 (2020), which also introduced .terraform.lock.hcl, terraform providers lock, and terraform providers mirror.
SEE ALSO
terraform(1), terraform-init(1), terraform-plan(1), tofu(1)
