Plain language
A provider is a plugin that teaches Terraform how to manage one platform or service. Each provider defines resource types (things to create and manage, such as random_pet) and data sources (things to read, such as aws_ami). Terraform core handles the language, graph, plan, and state. The provider handles the API calls.
Under the hood
- Discovery. Terraform reads
required_providersin every module of your configuration. - Installation.
terraform initdownloads each provider binary, by default from the public Terraform Registry atregistry.terraform.io, into.terraform/providers/. - Execution. During
planandapply, core starts each provider as a separate process and talks to it over an RPC plugin protocol. It asks the provider for schemas, refreshes objects, plans diffs, and applies changes.
Source addresses use the form [HOSTNAME/]NAMESPACE/TYPE:
| You write | Full address |
|---|---|
hashicorp/random |
registry.terraform.io/hashicorp/random |
kreuzwerker/docker |
registry.terraform.io/kreuzwerker/docker |
app.terraform.io/acme/internal |
A provider in an HCP Terraform private registry |
Local names. The key you use inside required_providers (for example random = {...}) is the provider's local name. Resource types are matched to providers by their prefix: random_pet belongs to the provider whose local name is random.
Registry tiers:
| Tier | Who publishes it |
|---|---|
| Official | Owned and maintained by HashiCorp (the hashicorp/ namespace) |
| Partner | Third-party technology companies that have joined HashiCorp's partner program |
| Community | Individuals and groups |
You can find binaries in the Terraform Registry or in a private registry. HCP Terraform supports a private registry for both providers and modules.