databricks / terraform-provider-databricks

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

[ISSUE] Unexpected error provisioning workspace: Deployment name cannot be used until a deployment name prefix is defined #1314

Closed easel closed 2 years ago

easel commented 2 years ago

Attempting to create a Databricks workspace using databricks_mws_workspaces results in the following unexpected response from the Databricks api: Deployment name cannot be used until a deployment name prefix is defined. Please contact your Databricks representative

Configuration

terraform {
  required_providers {
    databricks = {
      source = "databrickslabs/databricks"
      version = "0.5.7"
    }
    aws = {
      source  = "hashicorp/aws"
      version = "4.12.1"
    }
  }
}

provider "aws" {
  region = var.region
}

// initialize provider in "MWS" mode to provision new workspace
provider "databricks" {
  alias    = "mws"
  host     = "https://accounts.cloud.databricks.com"
  username = var.databricks_account_username
  password = var.databricks_account_password
}

resource "databricks_mws_workspaces" "this" {
  provider        = databricks.mws
  account_id      = var.databricks_account_id
  aws_region      = var.region
  workspace_name  = local.prefix
  deployment_name = local.prefix

  credentials_id           = databricks_mws_credentials.this.credentials_id
  storage_configuration_id = databricks_mws_storage_configurations.this.storage_configuration_id
  network_id               = databricks_mws_networks.this.network_id

  token {
    comment = "Terraform"
  }
}

Expected Behavior

A Databricks workspace is provisioned.

Actual Behavior

module.databricks.databricks_mws_workspaces.this: Creating...
╷
│ Error: cannot create mws workspaces: MALFORMED_REQUEST: Failed parameter validation checks: Deployment name cannot be used until a deployment name prefix is defined. Please contact your Databricks representative

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Terraform and provider versions

❯ terraform version
Terraform v1.1.9
on darwin_amd64
+ provider registry.terraform.io/databrickslabs/databricks v0.5.7
+ provider registry.terraform.io/hashicorp/aws v4.12.1
+ provider registry.terraform.io/hashicorp/random v3.1.3

Debug Output

2022-05-17T11:31:20.395-0400 [WARN]  provider.terraform-provider-databricks_v0.5.7: /api/2.0/accounts/528bd163-c922-4012-8676-e7f79d6250dc/workspaces:400 - MALFORMED_REQUEST: Failed parameter validation checks: Deployment name cannot be used until a deployment name prefix is defined. Please contact your Databricks representative: timestamp=2022-05-17T11:31:20.394-0400
2022-05-17T11:31:20.395-0400 [WARN]  provider.terraform-provider-databricks_v0.5.7: /api/2.0/accounts/528bd163-c922-4012-8676-e7f79d6250dc/workspaces:400 - MALFORMED_REQUEST: Failed parameter validation checks: Deployment name cannot be used until a deployment name prefix is defined. Please contact your Databricks representative: timestamp=2022-05-17T11:31:20.395-0400

Important Factoids

It's not clear to me that this is a provider problem, but if it's truly some sort of a "negotiate this with your Databricks rep" issue, it would be great to call it out in the documentation.

nfx commented 2 years ago

@easel did you contact your Databricks representative, like Solutions Architect, Customer Success Engineer, or Account Executive?

easel commented 2 years ago

@nfx we are a Databricks partner and I've tried that channel unsuccessfully so far.

nfx commented 2 years ago

@easel yes, your Partner SA should be able to set a prefix for you. currently deployment prefix is not self-service. Need to mention that in the docs more explicitly.

what'll work for now to unblock you - making a workspace without a deployment_name and you'll get a default one dbc-XXXXXX.cloud.databricks.com URL.

easel commented 2 years ago

@nfx perfect, thanks for the explainer and unblock!

easel commented 2 years ago

Commenting out the deployment name worked great. I've commented it out of the "worked example" I was following with an explanatory note in #1315.