Skip to content

[aws-databricks-unity-catalog] databricks_default_namespace_setting is a workspace-level resource but module requires account-level (MWS) provider only #230

@gham-khaled

Description

@gham-khaled

Module

modules/aws-databricks-unity-catalog Link

Summary

The aws-databricks-unity-catalog module contains a databricks_default_namespace_setting resource in main.tf:

  resource "databricks_default_namespace_setting" "this" {
    namespace {
      value = "main"
    }
  }

databricks_default_namespace_setting is a workspace-level resource — it must be applied via a provider pointed at a specific workspace host. However, the module is designed to be called with the account-level MWS provider pointed at https://accounts.cloud.databricks.com

  module "databricks_metastore" {
    source = "../../modules/aws-databricks-unity-catalog"

    providers = {
      databricks = databricks.mws  
    }
    ...
  }

When Terraform attempts to create databricks_default_namespace_setting using the MWS provider, it targets accounts.cloud.databricks.com instead of a workspace host, resulting in an API error at apply time.

Suggested Fix

  1. databricks_default_namespace_setting is removed from this module entirely
  2. A boolean variable (e.g. manage_default_namespace_setting = false) is added to allow callers to opt out, or
  3. The module accepts an optional workspace-level provider alias and conditionally creates the resource only when it is supplied

Environment

  • Terraform: >= 1.10.0
  • Databricks provider: ~> 1.0
  • AWS provider: ~> 5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions