Databricks - aws / creation of metastore using terraform

36 views Asked by At

Hi guys I'm creating a workspace using terraform for databricks that will deploy everything on aws. After the creation of workspace using Provisioning AWS Databricks E2:


 resource "databricks_mws_workspaces" "this" {
  provider       = databricks.workspace
  account_id     = var.databricks_account_id
  aws_region     = var.region
  workspace_name = var.workspace_name
  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"
  }
}

This workspace will be created with a metastore linked to it.

creation of the metastore:


resource "databricks_metastore" "this" {
  provider =  databricks.workspace
  name          = "primary"
  owner         = local.databricks_users_yaml["unity_admin_group"]
  storage_root  = "s3://${aws_s3_bucket.metastore.id}/metastore"
  force_destroy = true
}


resource "databricks_metastore_assignment" "default_metastore" {
  provider =  databricks.workspace
  workspace_id         = var.databricks_workspace_ids
  metastore_id         = databricks_metastore.this.id
  default_catalog_name = "hive_metastore"
} 

I'm getting this error: This account with id xxx-xx-xx-xx-xx has reached the limit for meta stores in region eu-central-1

it will only work if I manually remove the metastore created by default after the creation of the workspace so I can create metastore with terraform. if there a way to get the metastore id created by default or remove it so I can a metastore lineked to a workspace ?

0

There are 0 answers