Closed rishabhtrivedi23 closed 1 year ago
You might find this comment interesting because the user had the same error message.
@scheleaap The error message is same, However I followed the same approach which he is suggesting.
This is resolved after using a workspace URL which is already part of unity metastore in provider.tf
Configuration
provider.tf
terraform { required_providers { databricks = { source = "databricks/databricks" version = "1.17.0" } google = { source = "hashicorp/google" version = "4.65.0" } } }
provider "google" { project = var.google_project_name region = var.google_region }
provider "databricks" { alias = "accounts" host = var.account_console_url account_id = var.databricks_account_id google_service_account = var.google_service_account_email rate_limit = 2 }
provider "databricks" { alias = "workspace" host = var.admin_workspace_url google_service_account = var.google_service_account_email account_id = var.databricks_account_id rate_limit = 2 }
module.tf
resource "databricks_mws_permission_assignment" "admin_group" { provider = databricks.ac workspace_id = databricks_mws_workspaces.workspace.workspace_id principal_id = data.databricks_group.admin_group.id permissions = ["ADMIN"] }
resource "databricks_mws_permission_assignment" "user_group" { provider = databricks.ac workspace_id = databricks_mws_workspaces.workspace.workspace_id principal_id = data.databricks_group.user_group.id permissions = ["USER"] } main.tf
module "workspace" { providers = { databricks.ac = databricks.accounts databricks.ws = databricks.workspace }
Expected Behavior
It should assign permissions.
Actual Behavior
Error: cannot create mws permission assignment: Permission assignment APIs are not available for this workspace. │ │ with module.workspace.databricks_mws_permission_assignment.user_group, │ on ......\modules\databricks\buildworkspace\buildworkspace.tf line 73, in resource "databricks_mws_permission_assignment" "user_group": │ 73: resource "databricks_mws_permission_assignment" "user_group" { │
Steps to Reproduce
Terraform and provider versions
Terraform v1.4.6 on windows_amd64
Debug Output
Important Factoids
We are also creating the workspace in same module, when we try to run this after 10-15 minutes, the same workflow runs fine. Do we need to add timer in between to wait for something ?