Skip to content

[ISSUE] Issue with workspace provider on newly created workspaces #5882

Description

@kevin-zwartscholten

Description

From provider version 1.114.0 and onward, I get errors on terraform plan/apply when I create a new workspace and resources in that workspace in the same deployment. Below an example with databricks_workspace_conf, but this error seems to happen for all resources created with a workspace provider.

Configuration

provider "databricks" {
  alias = "mws"
  host  = "https://accounts.cloud.databricks.com"
}

resource "databricks_mws_workspaces" "workspace" {
  account_id                  = var.databricks_account_id
  workspace_name              = "my-workspace"
  aws_region                  = "<region>"
  compute_mode                = "SERVERLESS"
}


provider "databricks" {
  alias = "workspace"
  host  = databricks_mws_workspaces.workspace.workspace_url
}

resource "databricks_workspace_conf" "this" {
  provider = databricks.workspace

  custom_config = {
    "maxTokenLifetimeDays" = "30"
  }
}

Expected Behavior

terraform plan and terraform apply should succeed without error

Actual Behavior

│ Error: managing workspace-level resources requires a workspace_id, but none was found in the resource's provider_config block or the provider's workspace_id attribute
│ 
│   with databricks_workspace_conf.this,
│   on main.tf line 19, in resource "databricks_workspace_conf" "this":
│   19: resource "databricks_workspace_conf" "this" {
│ 
╵

It seems to be the issue that the workspace_id does not exist yet, because even if I configure workspace_id on the provider or add provider_config block to the databricks_workspace_conf I get the same issue. If I deploy in two steps, first the databricks_mws_workspaces and then the databricks_workspace_conf I do not run into this issue.

Steps to Reproduce

terraform plan / terraform apply

Terraform and provider versions

1.114.0 this started happening, issue is still present in 1.121.0

Is it a regression?

Yes, this worked until 1.113.0

Debug Output

Error: -14T11:23:48.006Z [ERROR] provider.terraform-provider-databricks_v1.114.0: Response contains error diagnostic: tf_resource_type=databricks_workspace_conf tf_rpc=PlanResourceChange @caller=/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.30.0/tfprotov6/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_detail="" diagnostic_severity=ERROR diagnostic_summary="managing workspace-level resources requires a workspace_id, but none was found in the resource's provider_config block or the provider's workspace_id attribute" tf_proto_version=6.11 tf_provider_addr=registry.terraform.io/databricks/databricks tf_req_id=513fc9cd-a95e-e399-d49f-7cff79caaf3c timestamp=2026-07-14T11:23:48.006Z
Error: -14T11:23:48.006Z [ERROR] vertex "databricks_workspace_conf.this" error: managing workspace-level resources requires a workspace_id, but none was found in the resource's provider_config block or the provider's workspace_id attribute
Error: -14T11:23:48.006Z [ERROR] vertex "databricks_workspace_conf.this (expand)" error: managing workspace-level resources requires a workspace_id, but none was found in the resource's provider_config block or the provider's workspace_id attribute

Important Factoids

Would you like to implement a fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions