From 528e7290190052beffb903bb8b9df7fa759a438f Mon Sep 17 00:00:00 2001 From: Alex Ott Date: Wed, 4 Dec 2024 17:45:04 +0100 Subject: [PATCH] Fixes after the discussion with UC Credentials team --- catalog/resource_workspace_binding.go | 12 +++++++----- docs/resources/workspace_binding.md | 2 +- internal/acceptance/workspace_binding_test.go | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/catalog/resource_workspace_binding.go b/catalog/resource_workspace_binding.go index fc2c0825f..8cad59774 100644 --- a/catalog/resource_workspace_binding.go +++ b/catalog/resource_workspace_binding.go @@ -44,11 +44,13 @@ func ResourceWorkspaceBinding() common.Resource { Default: "catalog", } common.CustomizeSchemaPath(m, "securable_type").SetValidateFunc(validation.StringInSlice([]string{ - "catalog", "external_location", "storage_credential", "service_credential"}, false)) - common.CustomizeSchemaPath(m, "binding_type").SetDefault(catalog.WorkspaceBindingBindingTypeBindingTypeReadWrite).SetValidateFunc(validation.StringInSlice([]string{ - string(catalog.WorkspaceBindingBindingTypeBindingTypeReadWrite), - string(catalog.WorkspaceBindingBindingTypeBindingTypeReadOnly), - }, false)) + "catalog", "external_location", "storage_credential", "credential"}, false)) + common.CustomizeSchemaPath(m, "binding_type").SetDefault( + catalog.WorkspaceBindingBindingTypeBindingTypeReadWrite).SetValidateFunc( + validation.StringInSlice([]string{ + string(catalog.WorkspaceBindingBindingTypeBindingTypeReadWrite), + string(catalog.WorkspaceBindingBindingTypeBindingTypeReadOnly), + }, false)) return m }, ) diff --git a/docs/resources/workspace_binding.md b/docs/resources/workspace_binding.md index 06cb4a856..2064bc557 100644 --- a/docs/resources/workspace_binding.md +++ b/docs/resources/workspace_binding.md @@ -33,7 +33,7 @@ The following arguments are required: * `workspace_id` - ID of the workspace. Change forces creation of a new resource. * `securable_name` - Name of securable. Change forces creation of a new resource. -* `securable_type` - Type of securable. Can be `catalog`, `external-location`, `storage-credential` or `service_credential`. Default to `catalog`. Change forces creation of a new resource. +* `securable_type` - Type of securable. Can be `catalog`, `external_location`, `storage_credential` or `credential`. Default to `catalog`. Change forces creation of a new resource. * `binding_type` - (Optional) Binding mode. Default to `BINDING_TYPE_READ_WRITE`. Possible values are `BINDING_TYPE_READ_ONLY`, `BINDING_TYPE_READ_WRITE`. ## Import diff --git a/internal/acceptance/workspace_binding_test.go b/internal/acceptance/workspace_binding_test.go index 74768259f..48c07b485 100644 --- a/internal/acceptance/workspace_binding_test.go +++ b/internal/acceptance/workspace_binding_test.go @@ -74,7 +74,7 @@ func workspaceBindingTemplateWithWorkspaceId(workspaceId string) string { resource "databricks_workspace_binding" "service_cred" { securable_name = databricks_credential.credential.id - securable_type = "service_credential" + securable_type = "credential" workspace_id = %[1]s } `, workspaceId)