cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

cannot create external location: invalid Databricks Workspace configuration

manoj_2355ca
New Contributor III

HI All

I am trying to create databricks storage credentials , external location and catalog with terraform.

cloud : Azure

My storage credentials code is working correctly . But the external location code is throwing below error when executing the Terraform apply .

│ Error: cannot create external location: invalid Databricks Workspace configuration

│ with module.dbs_external_location.databricks_external_location.int_exl["prod"],
│ on ..\modules\dbs_external_location\exl_main.tf line 1, in resource "databricks_external_location" "int_exl":
│ 1: resource "databricks_external_location" "int_exl" {

can anyone please help me on this 

 

1 REPLY 1

manoj_2355ca
New Contributor III

HI @Retired_mod

Thanks for the reply . Even after correcting my databricks workspace provider configuration . I am not able to create 3 external location in databricks workspace.
i am using below code in terraform .
Provider .tf 

 

provider "databricks" {
  alias = "wrkshp"
  host = ""
  token = ""
 
in module file :
resource "databricks_external_location" "exl_dbs" {

  for_each = var.exl_name


  name = each.value["name"]

  url = each.value["url"]
  credential_name = var.storage_cred


  comment         = each.value["comment"]
  metastore_id = var.metid
 
in module terraform tf :
terraform {
  required_providers {
    databricks = {
      source  = "databricks/databricks"
      version = ">=1.33.0"
      configuration_aliases = [ databricks.wrkshp ]
    }
  }
}
 
in module variable tf:
variable "exl_name" {
  type = map(object({
    name = string
    url = string
    #credential_name = string
    comment = string
    metastore_id = string
  }))
  default = {
    "dev" = {
      name = ""
      url = ""
      #credential_name = ""
      comment = "Managed by Tf"
      metastore_id = ""      
    }
    "prod" = {
      name = ""
      url = ""
      #credential_name = ""
      comment = "Managed by TF"
      metastore_id = ""
    }
    "uat" = {
      name = ""
      url = ""
      #credential_name = ""
      comment = "Managed by TF"
      metastore_id = ""
    }
  }  
}

variable "storage_cred" {
  type = string
  default = ""
 
}

variable "metid" {
  type =  string
  default = ""
}
 
and in main module file :: 
module "dbs_external_location"  {
    source = "../modules/dbs_external_location"

    exl_name = var.exl_name
    storage_cred = module.dbs_storage_creds.storage_credential_id
    metid = data.databricks_metastore.int_meta.metastore_id

    providers = {

        databricks.wrkshp = databricks.wrkshp
    }
 
}
 
This is failing with below error . Not sure what is wrong .
 
module.dbs_external_location.databricks_external_location.exl_dbs["dev"]: Creating...
module.dbs_external_location.databricks_external_location.exl_dbs["prod"]: Creating...
module.dbs_external_location.databricks_external_location.exl_dbs["uat"]: Creating...

│ Error: cannot create external location: invalid Databricks Workspace configuration

│ with module.dbs_external_location.databricks_external_location.exl_dbs["prod"],
│ on ..\modules\dbs_external_location\exl_main.tf line 1, in resource "databricks_external_location" "exl_dbs":
│ 1: resource "databricks_external_location" "exl_dbs" {



│ Error: cannot create external location: invalid Databricks Workspace configuration

│ with module.dbs_external_location.databricks_external_location.exl_dbs["dev"],
│ on ..\modules\dbs_external_location\exl_main.tf line 1, in resource "databricks_external_location" "exl_dbs":
│ 1: resource "databricks_external_location" "exl_dbs" {



│ Error: cannot create external location: invalid Databricks Workspace configuration

│ with module.dbs_external_location.databricks_external_location.exl_dbs["uat"],
│ on ..\modules\dbs_external_location\exl_main.tf line 1, in resource "databricks_external_location" "exl_dbs":
│ 1: resource "databricks_external_location" "exl_dbs" {
 
can anyone help me on this .
 



Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group