Providers - Configuration Language - Terraform - HashiCorp Developer
Providers - Configuration Language - Terraform - HashiCorp Developer
Terraform relies on plugins called providers to interact with cloud providers, SaaS providers, and
other APIs.
Terraform configurations must declare which providers they require so that Terraform can install
and use them. Additionally, some providers require configuration (like endpoint URLs or cloud
regions) before they can be used.
What Providers Do
Each provider adds a set of resource types and/or data sources that Terraform can manage.
Every resource type is implemented by a provider; without providers, Terraform can't manage
any kind of infrastructure.
The Terraform Registry is the main directory of publicly available Terraform providers, and hosts
providers for most major infrastructure platforms.
https://developer.hashicorp.com/terraform/language/providers 1/5
12/11/24, 11:32 PM Providers - Configuration Language | Terraform | HashiCorp Developer
Provider Documentation
Each provider has its own documentation, describing its resource types and their arguments.
The Terraform Registry includes documentation for a wide range of providers developed by
HashiCorp, third-party vendors, and our Terraform 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.
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 Terraform can install them.
Dependency Lock File documents an additional HCL file that can be included with a
configuration, which tells Terraform to always use a specific set of provider versions.
Provider Installation
HCP Terraform and Terraform Enterprise install providers as part of every run.
Terraform CLI finds and installs providers when initializing a working directory. It can
automatically download providers from a Terraform registry, or load them from a local mirror
https://developer.hashicorp.com/terraform/language/providers 2/5
12/11/24, 11:32 PM Providers - Configuration Language | Terraform | HashiCorp Developer
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, Terraform CLI supports an optional plugin cache. You can
enable the cache using the plugin_cache_dir setting in the CLI configuration file.
To ensure Terraform always installs the same provider versions for a given configuration, you can
use Terraform CLI to create a dependency lock file and commit it to version control along with
your configuration. If a lock file is present, HCP Terraform, CLI, and Enterprise will all obey it
when installing providers.
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. The provider listings
use the following badges to indicate who develops and maintains a given provider.
https://developer.hashicorp.com/terraform/language/providers 3/5
12/11/24, 11:32 PM Providers - Configuration Language | Terraform | HashiCorp Developer
https://developer.hashicorp.com/terraform/language/providers 4/5
12/11/24, 11:32 PM Providers - Configuration Language | Terraform | HashiCorp Developer
Theme System
Certifications System Status Cookie Manager Terms of Use Security Privacy Trademark Policy
https://developer.hashicorp.com/terraform/language/providers 5/5