Auth0 Failed to Query Available Provider Packages Error Occurs During Terraform Init

Overview

Terraform generates a provider package error when initializing an Auth0 project. This occurs because the referenced Terraform provider in the auto-generated configuration file lacks a mapping in a specific child module. Explicitly declare the Auth0 provider within the child module to resolve the issue.

Applies To

  • Auth0
  • Terraform Provider

Cause

The error occurs because Terraform enforces provider requirements on a strictly per-module basis. When an auto-generated configuration file resides in a subdirectory or another module uses Auth0 resources without an explicit auth0/auth0 mapping, Terraform defaults to assuming the provider is maintained by <provider_name>/auth0.

Solution

To resolve the provider package error, identify the module requesting the incorrect provider and explicitly declare the Auth0 provider within that directory by following these steps:

  1. Run the terraform providers command in the terminal.
  2. Review the output to identify the specific child module requesting the incorrect <provider_name>/auth0 provider.
  3. Create a versions.tf file inside the identified child module folder.
  4. Enter the following configuration block into the file to explicitly map the Auth0 provider.
terraform {
  required_providers {
    auth0 = {
      source  = "auth0/auth0"
      version = ">= 1.0.0" # or <specific_version>
    }
  }
}

 

  1. Run the terraform init command again to initialize the project successfully.

Related References

Recommended content

No recommended content found...