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