databricks / terraform-provider-databricks

Databricks Terraform Provider
https://registry.terraform.io/providers/databricks/databricks/latest
Other
456 stars 393 forks source link

[ISSUE] Issue with `databricks_volume` resource #4261

Open owl2 opened 13 hours ago

owl2 commented 13 hours ago

Configuration

terraform {
  backend "azurerm" {
    resource_group_name  = "xxx"
    storage_account_name = "xxx"
    container_name       = "xxx"
    key                  = "xxx"
  }
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "4.2.0"
    }
    databricks = {
      source  = "databricks/databricks"
      version = "1.56.0"
    }
  }
}

Expected Behavior

A deployment of databricks_volume resource without error.

Actual Behavior

image

Steps to Reproduce

resource "databricks_external_location" "external" {
  depends_on = [ azurerm_role_assignment.external_sources ]

  # name = "dbx-external-sources"
  name = var.environment == "staging" || var.environment == "production" ? "xxx-${var.environment}" : "xxx"
  url = format("abfss://%s@%s.dfs.core.windows.net",
    azurerm_storage_container.external.name,
    azurerm_storage_account.external_sources.name)

  credential_name = databricks_storage_credential.external_sources.id
  owner = databricks_group.uc_admins.display_name
  comment         = "External Location"
}

resource "databricks_volume" "this" {
  name                  = "external_sources"
  catalog_name     = "xxx"
  schema_name     = databricks_schema.external_sources.name
  volume_type       = "EXTERNAL"
  storage_location = databricks_external_location.external.url
  comment            = "This volume is managed by terraform"
}

Terraform and provider versions

Is it a regression?

I don't think so.

Important Factoids

This happened twice, but restarting fixed it. I create this Issue just in case. Tell me if it's interesting or not.

Would you like to implement a fix?

Why not...

alexott commented 13 hours ago

Add trailing / to url value...