Problem
You are installing the Databricks Terraform provider (AWS | Azure | GCP) and get a Databricks provider registry error.
Error while installing hashicorp/databricks: provider registry registry.terraform.io does not have a provider named registry.terraform.io/hashicorp/databricks
Cause
This error occurs when the required_providers block is not defined in every module that uses the Databricks Terraform provider.
Solution
Create a versions.tf tệp tin with the following contents:
# versions.tf terraform { required_providers { databricks = { source = "databricks/databricks" version = "1.0.0" } } }
Save a copy of this version.tf tệp tin in every module in the environments level of your code base.
Remove the version field from the versions.tf tệp tin and save a copy of the updated tệp tin in every module in the modules level of your code base.
For example:
├── environments │ ├── sandbox │ │ ├── README.md │ │ ├── main.tf │ │ └── versions.tf // This tệp tin contains the "version" field. │ └── production │ ├── README.md │ ├── main.tf │ └── versions.tf // This tệp tin contains the "version" field. └── modules ├── first-module │ ├── ... │ └── versions.tf // This tệp tin does NOT contain the "version" field. └── second-module ├── ... └── versions.tf // This tệp tin does NOT contain the "version" field.
Review the Requiring providers Terraform documentation for more information.