terraform-provider-databricks icon indicating copy to clipboard operation
terraform-provider-databricks copied to clipboard

[ISSUE] Issue with `databricks_mws_workspaces` resource with SA and oauth2

Open Israphel opened this issue 6 months ago • 7 comments

Configuration

# Databricks (Workspaces management)
provider "databricks" {
  alias         = "mws"
  host          = "https://accounts.cloud.databricks.com"
  account_id    = local.databricks_account_id
  client_id     = var.databricks_client_id
  client_secret = var.databricks_client_secret
}

Expected Behavior

I was using username and password but that doesn't work anymore. So I made a service account in here and I gave it Account admin role. Then I made an OAuth secrets and I stored the secret as var.databricks_client_secret and the UUID of the SA as var.databricks_client_id

Actual Behavior

I get

│ Error: cannot read mws workspaces: cannot read token: inner token: oauth2: "invalid_client" "Client authentication failed"
│
│   with module.databricks-workspace-us-east-1.databricks_mws_workspaces.workspace,
│   on .terraform/modules/databricks-workspace-us-east-1/main.tf line 2, in resource "databricks_mws_workspaces" "workspace":
│    2: resource "databricks_mws_workspaces" "workspace" {

Steps to Reproduce

terraform plan

Terraform and provider versions

terraform {
  required_version = "1.4.6"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.59.0"
    }
    databricks = {
      source  = "databricks/databricks"
      version = "1.25.1"
    }
  }
}

Is it a regression?

It worked when username/password was accepted.

Israphel avatar Aug 02 '24 18:08 Israphel