Safeguard
Supply Chain•

What is a Terraform provider source address and why check it?

A source address like hashicorp/aws tells Terraform which registry and namespace to trust. How omitted hostnames work and what to check in review.

Safeguard Security Team
3 min read

A provider source address names where a provider comes from: a hostname, a namespace and a type, such as registry.terraform.io/hashicorp/aws. For the public registry you may omit the hostname and write hashicorp/aws. Checking the namespace in review is how you notice an unexpected publisher.

Anatomy of an address

The origin registry for a provider is encoded in its source address. Terraform allows you to leave out the hostname for providers on registry.terraform.io, so hashicorp/aws and the full form mean the same thing. In a required_providers block, each local name maps to a source address and a version constraint.

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

Why the address matters

The namespace identifies who published the provider. Two providers with similar types but different namespaces are different programs. A change from one namespace to another in a pull request changes who supplies code that runs with your cloud credentials. Local names are only labels inside your module, so the source line is what decides.

Review checklist

CheckQuestion
NamespaceIs the publisher the one you expect?
HostnameIs it the public registry, or a private host you control?
TypeDoes the name match the provider you meant, with no near miss?
VersionIs it constrained, and does the lock file agree?
New entryHas the lock file gained a provider block to match?

Shorthand and mirrors

The omitted hostname rule also applies to installation patterns. In provider_installation, registry.terraform.io/hashicorp/* and hashicorp/* are equivalent, and */* is shorthand for registry.terraform.io/*/*. If you use a mirror, patterns decide which providers it serves, so keep them precise.

Steps for a safe addition

  1. Find the provider on its registry page and note the namespace and source link.
  2. Write the full source address in your block.
  3. Run terraform init and read the key ID message.
  4. Commit the lock file change with the block change.
  5. Ask a second reviewer to confirm the namespace.

Modules that bring providers

A child module can require providers too. When you add an external module, check its required_providers blocks for sources you did not choose, because init will select and record them in the lock file.

Quick check

Can I leave out the hostname?

For providers on registry.terraform.io, yes. Terraform allows the shorter form.

Is the local name the source of truth?

No. The source argument decides which provider is installed.

Will init add child module providers to the lock file?

Yes. A new provider requirement from a module is selected and recorded.

Safeguard offers SBOM and dependency scanning and policy gates that can block a pull request on findings, and you can try a free scan at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.