OpenTofu relies on plugins called providers to interact with cloud providers, SaaS providers, and other APIs.
OpenTofu configurations must declare which providers they require so that OpenTofu can install and use them. Additionally, some providers require configuration (like endpoint URLs or cloud regions) before they can be used.
What Providers Do
Every resource type is implemented by a provider; without providers, OpenTofu can't manage any kind of infrastructure.
Most providers configure a specific infrastructure platform (either cloud or self-hosted). Providers can also offer local utilities for tasks like generating random numbers for unique resource names.
Where Providers Come From
Providers are distributed separately from OpenTofu itself, and each provider has its own release cadence and version numbers.
The Public Terraform Registry is the main directory of publicly available providers, and hosts providers for most major infrastructure platforms.
Each provider has its own documentation, describing its resource types and their arguments.
The Public Terraform Registry includes documentation for a wide range of providers developed by HashiCorp, third-party vendors, and our OpenTofu community. Use the "Documentation" link in a provider's header to browse its documentation.
Provider documentation in the Registry is versioned; you can use the version menu in the header to change which version you're viewing.
For details about writing, generating, and previewing provider documentation, see the provider publishing documentation.
How to Use Providers
Providers are released separately from OpenTofu itself and have their own version numbers. In production we recommend constraining the acceptable provider versions in the configuration's provider requirements block, to make sure that
tofu init does not install newer versions of the provider that are incompatible with the configuration.
To use resources from a given provider, you need to include some information about it in your configuration. See the following pages for details:
Provider Requirements documents how to declare providers so OpenTofu can install them.
Provider Configuration documents how to configure settings for providers.
Dependency Lock File documents an additional HCL file that can be included with a configuration, which tells OpenTofu to always use a specific set of provider versions.
TACOS (TF Automation and Collaboration Software) install providers as part of every run.
OpenTofu CLI finds and installs providers when initializing a working directory. It can automatically download providers from a provider registry, or load them from a local mirror or cache. If you are using a persistent working directory, you must reinitialize whenever you change a configuration's providers.
To save time and bandwidth, OpenTofu CLI supports an optional plugin cache. You can enable the cache using the
plugin_cache_dirsetting in the CLI configuration file.
To ensure OpenTofu always installs the same provider versions for a given configuration, you can use OpenTofu CLI to create a dependency lock file and commit it to version control along with your configuration. If a lock file is present, OpenTofu CLI, and TACOS (TF Automation and Collaboration Software) will all obey it when installing providers.
How to Find Providers
To find providers for the infrastructure platforms you use, browse the Public Terraform Registry.
Some providers on the Registry are developed and published by HashiCorp, some are published by platform maintainers, and some are published by users and volunteers.
How to Develop Providers
Providers are written in Go, using the Terraform Plugin SDK. For more information on developing providers, see the Plugin Development documentation.