- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2022 01:38 AM
i created unity catalog using terraform on AWS, and able to create manualy a meta store with same user.
when trying to create metsastore from terraform, i get unauthorized error:
Error: cannot create metastore: Unauthorized
│
│ with module.unity_catalog_metastore.databricks_metastore.this,
│ on modules/uc_metastore/main.tf line 1, in resource "databricks_metastore" "this":
│ 1: resource "databricks_metastore" "this" {
provider:
databricks = {
source = "databricks/databricks"
version = "~>1.2.1"
}
i use the mws provider with user and password:
provider "databricks" {
alias = "mws"
host = "https://accounts.cloud.databricks.com"
account_id = var.databricks_account_id
username = var.databricks_username
password = var.databricks_password
}
my user is account admin (otherwise i wouldnt be able to create the catalog itself..)
the resource configuration:
resource "databricks_metastore" "this" {
name = "primary"
storage_root = "s3://${var.unity_metastore_bucket}/metastore"
owner = var.unity_admin_group
force_destroy = true
}
Any idea?
Thanks,
Amit
- Labels:
-
Amit
-
Unity Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 07:23 AM
Hello @Amit Cahanovich ,
You'll need to use the workspace provider when creating a UC metastore using TF. Please use this guide - https://registry.terraform.io/providers/databricks/databricks/latest/docs/guides/unity-catalog#creat...
Few things to note
- Unity catalogue APIs are currently exposed via the workspace endpoint, not the account endpoint. When you create via UI it uses account-level API but it's still not exposed to the public.
https://api-docs.databricks.com/rest/latest/unity-catalog-api-specification-2-1.html
For better understanding, you could also check a similar query here - https://discuss.hashicorp.com/t/databricks-unity-catalog-account-vs-workspace-level-understanding/42...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 09:47 AM
thanks 🙂