Providers and the registry

Beginner · 6 min

What a provider is, how a source address like hashicorp/aws turns into a signed download from a registry, and how Terraform's and OpenTofu's registries differ.

Before thisInit, validate, plan, apply and destroy in practiceHCL syntax: blocks, arguments and expressions

Tech Tutorials with Piyush · 31 min · from 0:36

Providers and the registry

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by Tech Tutorials with PiyushReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • Terraform core knows nothing about any cloud. A provider is a separate program that implements resources and data sources for one API, and core talks to it over a plugin protocol.
  • A source address `namespace/type`, such as `hashicorp/aws`, names the provider. The registry turns it into a download URL, a checksum and a signing key.
  • Registry tiers say who maintains a provider: official (HashiCorp), partner (the vendor) and community. The tier is a hint about support.
  • OpenTofu has its own registry. It serves the `hashicorp/` providers as rebuilt binaries with different checksums and signing keys.
  • `required_providers` names the source and a version constraint. Always set both, so `init` is repeatable.

The binary that knows nothing

Terraform’s download is 123 MB, as we saw when verifying it, and it contains no knowledge of AWS, Azure, GitHub or DNS. That surprises people. If you picture one program that “supports clouds”, you would expect a new service launch to need a new Terraform release.

It works the other way. Terraform core handles the language, the graph, state and the plan. Everything about a particular API lives in a provider, a separate program that core starts and talks to over a defined protocol. When AWS launches a service, the AWS provider ships a release. When you upgrade the provider, Terraform stays as it was.

What a provider contains

A provider implements two kinds of things: resource types you create and manage, such as aws_s3_bucket, and data sources you read, such as aws_vpc. Core asks the provider to read, plan and apply each one. The provider turns that into calls on the vendor’s API. Since Terraform 1.8, a provider can also contribute functions, called as provider::name::function(), according to the v1.8 changelog.

You give a provider its configuration, such as a region and credentials, in a provider block. The next lesson covers several configurations of one provider, and the one after covers pinning versions.

Source addresses

In required_providers you name each provider by source. Written from the Terraform docs and not run:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 6.0"
    }
  }
}

hashicorp/aws is namespace/type. The full form includes a hostname: registry.terraform.io/hashicorp/aws. The word aws on the left is a local name you choose, and it is what resource types like aws_instance match by prefix. The Terraform terraform block docs say that if you leave out version, init installs the newest. That is why you always set one.

What the registry returns

The registry has a plain HTTP API, which I used. This is what terraform init asks for, in outline. I called the endpoints directly and did not run Terraform:

$ curl -s https://registry.terraform.io/.well-known/terraform.json
{"modules.v1":"/v1/modules/","providers.v1":"/v1/providers/"}
$ curl -s https://registry.terraform.io/v1/providers/hashicorp/local/2.9.1/download/darwin/arm64 | jq '{filename,download_url,shasum,protocols,signing_keys:(.signing_keys.gpg_public_keys|map(.key_id))}'
{
  "filename": "terraform-provider-local_2.9.1_darwin_arm64.zip",
  "download_url": "https://releases.hashicorp.com/terraform-provider-local/2.9.1/terraform-provider-local_2.9.1_darwin_arm64.zip",
  "shasum": "25ac210f136042047975896e5e11fe6012425301c826d6b7ce22a49f96a1e0e8",
  "protocols": ["5.0"],
  "signing_keys": ["34365D9472D7468F"]
}

A discovery document says where the provider API lives. Then, for a version, operating system and architecture, the registry answers with a download URL, the checksum of the zip, the plugin protocol version, and the ID of the key that signed the release. I downloaded that zip and checked its SHA-256 against the shasum field: 25ac210f..., and they matched. Inside the zip were one 17 MB program, terraform-provider-local_v2.9.1_x5, and a licence. That executable is the provider. I did not run it.

Because the response is per platform, one provider version has several zips. The next lessons show why the lock file records a hash for each.

Tiers

Each provider has a tier on the registry. I looked up four:

{"id":"hashicorp/aws/6.74.0","tier":"official","downloads":8659723560}
{"id":"integrations/github/6.13.0","tier":"partner","downloads":427607074}
{"id":"cloudflare/cloudflare/5.29.0","tier":"partner","downloads":403941817}
{"id":"hashicorp/local/2.9.1","tier":"official","downloads":1366252335}

Official providers are maintained by HashiCorp. Partner providers are maintained by the vendor of the service, such as Cloudflare or GitHub. Everything else is community. Tier tells you who to complain to. Before adopting a community provider, check the date of the last release, the open issues and the number of maintainers. A provider is code that runs with your credentials.

OpenTofu has its own registry

OpenTofu reads the same HCL and the same source addresses, but it asks registry.opentofu.org by default. I queried both registries for hashicorp/random 3.6.2, darwin arm64:

OpenTofu registry:   shasum 2a58e665...  key 0C0AF313E5FD9F80  download_url on github.com/opentofu/...
Terraform registry:  shasum 37c75d15...  key 34365D9472D7468F  download_url on releases.hashicorp.com

The same version number gives different zips. The OpenTofu project’s docs API carries a notice that the OpenTofu project only builds the binaries for hashicorp/ providers from HashiCorp’s source, and recommends keeping the hashicorp/ namespace. The practical effect, by my reading of the numbers and not from running tofu, is that the hashes in a lock file made by Terraform will not match OpenTofu’s builds, so expect a checksum complaint on tofu init until the entry is regenerated. The lock-file lesson shows the hashes in detail.

Writing your own?

Providers are Go programs built with a framework, and HashiCorp has a tutorial on building one. Few teams need to. If there is no provider for an internal API, check first whether a general http or restapi provider would do.

About the video

The embed is “What is a Terraform Provider?” through the registry docs and the start of versioning, 0:36 to 7:04, in Tech Tutorials with Piyush’s “2/30 - Terraform AWS Provider explained”, November 2025, 31 minutes in full. Its chapters cover provider types, exploring the AWS provider documentation and version constraints. The rest of the video builds a first AWS script and sets up IAM access keys, which I cut, and the keys part is the opposite of the no static keys lesson later in this group. English was judged from title, channel and English auto-captions. The registry details above come from my own API calls, not the video.

Where this fits

One provider block per provider is the simple case. The common real-world case is two regions or two accounts at once: provider configuration, aliases and multi-region.

Check yourself

  1. 01Why does `terraform init` download anything, if Terraform is already installed?

    The binary contains only the core: parsing, graph and state logic. Every resource type lives in a provider plugin, which `init` fetches from a registry according to `required_providers`.

  2. 02What does the address `registry.terraform.io/hashicorp/aws` break down into?

    A hostname, a namespace and a type: the registry to ask, who publishes it and the provider's name. The short form `hashicorp/aws` leaves out the hostname, which is the default registry.

  3. 03A provider from a `partner` tier and one from `community` tier are both on the registry. What is the real difference?

    Who stands behind it. A partner provider is maintained by the vendor of the service and went through HashiCorp's partner process. Community providers are published by anyone, so check activity and issue history before depending on one.

  4. 04Why might the same `hashicorp/random` 3.6.2 produce a different checksum under OpenTofu?

    OpenTofu's registry serves its own builds of that provider's source, signed with its own key, so the zip contents and hash differ from HashiCorp's.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark