Closed KarthicPortal closed 1 year ago
Hi @KarthicPortal 👋
Could you share the code that you are using to create the databricks_catalog_workspace_binding
resource?
From the error message it seems that it is expecting an integer for the workspace_id
🤔
Hi.. Thanks for the response.
Here is our code:
code flow: main.ts --> unity-catalog.ts
main.ts
-------
import { UnityCatalog } from "../../adp/organisms/unity-catalog"
export class ADPStack extends TerraformStack {
static readonly COMMON_CONFIG_FILE = "common-config.yaml";
static readonly UTF8_ENCODING: "utf8";
constructor(scope: Construct, name: string) {
super(scope, name);
new UnityCatalog(this, {
unityDatabricksWorkspace: {
name: "dbw-mblb-dev-dmlzz-dpms-neu",
resourceGroupName: "rg-mblb-dev-dmlzz-dpms-neu"
},
catalogDbwBinding: ["mobilab-dlz-dev-catalog"] // Catalogs from other Databricks, not from DMLZ Databricks;
}, naming)
}
}
unity-catalog.ts
----------------
import { DataAzurermDatabricksWorkspace } from "@cdktf/provider-azurerm/lib/data-azurerm-databricks-workspace";
import { CatalogWorkspaceBinding } from "@cdktf/provider-databricks/lib/catalog-workspace-binding";
export interface UnityCatalogConfig extends AdpCommonConfig {
readonly component: string,
readonly unityStorageAccount: {
readonly name: string,
readonly resourceGroupName: string,
},
readonly unityDatabricksWorkspace: {
readonly name: string,
readonly resourceGroupName: string,
},
readonly catalogDbwBinding?: string[]
}
export class UnityCatalog {
constructor(scope: Construct, inputConfig: UnityCatalogConfig, naming: DefaultNaming) {
const dbw = new DataAzurermDatabricksWorkspace(scope, `data-dbw-${config.workload}-${config.component}`, {
name: config.unityDatabricksWorkspace.name,
resourceGroupName: config.unityDatabricksWorkspace.resourceGroupName
})
let dbwProvider = new DatabricksProvider(scope, `databricks-provider2-${config.workload}-${config.component}`, {
host: dbw.workspaceUrl,
azureWorkspaceResourceId: dbw.id,
alias: "unityCatalog"
})
config.catalogDbwBinding?.forEach(bind => {
new CatalogWorkspaceBinding(scope, `catalog-${bind}-dbw-binding`,{
catalogName: bind,
workspaceId: dbw.id
})
})
}, naming)
}
workspaceId supposed to be string right?
Hi @KarthicPortal 👋
Thank you for supplying the code. Much appreciated!
workspaceId supposed to be string right?
From the error message it appears to be expecting an integer, but got "/subscriptions/3342***/resourceGroups/rg-mblb-dev-dmlzz-dpms-neu/providers/Microsoft.Databricks/workspaces/dbw-mblb-dev-dmlz-dpms-neu"
. You might have success trying dbw.workspaceId
instead of dbw.id
.
That said, this is an issue with the Databricks provider, so your best next bet would be to file an issue on the Databricks provider repository: https://github.com/databricks/terraform-provider-databricks/issues
As this error is not specific to CDKTF, I'm going to close this issue. But don't hesitate to reach out, if you run into any other problems with CDKTF!
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Expected Behavior
Hi,
We're trying to create catalog workspace binding via CDKTF. But unable to do so. Getting following error:
This works fine when I do it via Azure Databricks UI.
Actual Behavior
It should be able to create the binding between catalog and databricks workspace successfully
Steps to Reproduce
Versions
Providers
───────────────────────┬──────────────────┬─────────┬────────────┬────────────────────────────┬─────────────────┐ │ Provider Name │ Provider Version │ CDKTF │ Constraint │ Package Name │ Package Version │ ├───────────────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤ │ azuread │ 2.41.0 │ ^0.18.0 │ │ @cdktf/provider-azuread │ 10.0.0 │ ├───────────────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤ │ azurerm │ 3.72.0 │ ^0.18.0 │ │ @cdktf/provider-azurerm │ 10.0.2 │ ├───────────────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤ │ databricks/databricks │ 1.27.0 │ ^0.18.0 │ │ @cdktf/provider-databricks │ 10.0.6 │ ├───────────────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤ │ kreuzwerker/docker │ 3.0.2 │ ^0.18.0 │ │ @cdktf/provider-docker │ 9.0.0 │ ├───────────────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤ │ http │ 3.4.0 │ ^0.18.0 │ │ @cdktf/provider-http │ 7.0.0 │ ├───────────────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤ │ random │ 3.5.1 │ ^0.18.0 │ │ @cdktf/provider-random │ 9.0.0 │ ├───────────────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤ │ time │ 0.9.1 │ ^0.18.0 │ │ @cdktf/provider-time │ 8.0.0 │ └───────────────────────┴──────────────────┴─────────┴────────────┴────────────────────────────┴─────────────────┘
Gist
No response
Possible Solutions
No response
Workarounds
No response
Anything Else?
No response
References
No response
Help Wanted
Community Note