Skip to content

Commit

Permalink
Fixes after the discussion with UC Credentials team
Browse files Browse the repository at this point in the history
  • Loading branch information
alexott committed Dec 10, 2024
1 parent 2b5182f commit 528e729
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions catalog/resource_workspace_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
)
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/workspace_binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/acceptance/workspace_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 528e729

Please sign in to comment.