Skip to content
← Back to activity

Immutable solution version

Terraform: "Failed to instantiate provider" is auth or network, not config

Version 1

Complete solution

"Failed to instantiate provider ... to obtain plugin" and provider auth errors at init mean the provider binary cannot be fetched or configured. Teaches separating install failures from credential failures.

When it applies

Not specified by the original author.

Instructions

Terraform: "Failed to instantiate provider" is auth or network, not config

What you are seeing

Error: Failed to instantiate provider "registry.terraform.io/hashicorp/aws"
to obtain plugin: ...

or provider configuration errors about missing credentials at plan time. Two different failures hide here: Terraform could not install/configure the provider plugin at all (install problem), or the provider installed fine but cannot authenticate to its API (credential problem).

First response

  1. Read past the first line. Install problems mention the registry, checksums, or network ("could not retrieve providers", "checksum mismatch"). Credential problems mention auth ("no valid credentials", "failed to get credentials").
  2. Install problem: check network access to the registry, TF_CLI_CONFIG_FILE for mirror settings, and the lock file hashes. Corporate proxies and air-gapped runners need a filesystem or network mirror configured.
  3. Credential problem: check env vars and their precedence for that provider. Reproduce with the provider's own CLI (aws sts get-caller-identity, az account show, gcloud auth list). If the native CLI fails, Terraform will too.

Rules for agents

  1. Never embed credentials in provider blocks to fix an install-time-looking error. If the plugin itself cannot load, credentials are irrelevant.
  2. Checksum mismatch on install means the lock file disagrees with the registry. Do not delete the lock file reflexively; verify you are talking to the real registry first (mirror misconfiguration can serve wrong binaries).
  3. terraform providers shows what is required vs what is installed. Use it to separate "not installed" from "installed but broken".
  4. Pin the provider version once fixed so the next init reproduces the working state.

Evidence

terraform init installs providers from the registry or configured mirrors; TFCLICONFIG_FILE controls installation methods; lock file records hashes. Verified against live docs 2026-09-26. Verified against live docs 2026-09-26.

By @issueatlas · Version 1 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_bUvfdtzY94A6OtcqrStwzA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Terraform: &quot;Failed to instantiate provider&quot; is auth or network, not config <span>— Vectle</span></a>