You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alternative implementation of databricks_permission resource for managing permissions for individual principals.
This resource provides fine-grained control over permissions by managing a single principal's access to a single object, unlike `databricks_permissions`, which manages all principals' access to an object at once. This is particularly useful for:
- Managing permissions for different teams independently
- Token and password authorization permissions that previously required all principals in one resource
- Avoiding conflicts when multiple configurations manage different principals on the same object
Caveat: Since we cannot remove an individual permission, the `Delete` operation is performed as `Read/Put`, so we need to use a lock around each object.
Copy file name to clipboardExpand all lines: NEXT_CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
* Add `databricks_users` data source ([#4028](https://github.com/databricks/terraform-provider-databricks/pull/4028))
10
10
* Improve `databricks_service_principals` data source ([#5164](https://github.com/databricks/terraform-provider-databricks/pull/5164))
11
-
* Added `databricks_permission` resource for managing permissions on Databricks objects for individual principals ([#5161](https://github.com/databricks/terraform-provider-databricks/pull/5161)).
11
+
* Added `databricks_permission` resource for managing permissions on Databricks objects for individual principals ([#5186](https://github.com/databricks/terraform-provider-databricks/pull/5186)).
Copy file name to clipboardExpand all lines: docs/resources/permission.md
+51-39Lines changed: 51 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ This resource allows you to manage permissions for a single principal on a Datab
10
10
11
11
~> This resource is _authoritative_ for the specified object-principal pair. Configuring this resource will manage the permission for the specified principal only, without affecting permissions for other principals.
12
12
13
+
~> **Warning:** Do not use both `databricks_permission` and `databricks_permissions` resources for the same object. This will cause conflicts as both resources manage the same permissions.
14
+
13
15
-> Use `databricks_permissions` when you need to manage all permissions for an object in a single resource. Use `databricks_permission` (singular) when you want to manage permissions for individual principals independently.
*`object_type` - (Required) The type of object to manage permissions for. Valid values include:
173
+
*`clusters` - For cluster permissions
174
+
*`cluster-policies` - For cluster policy permissions
175
+
*`instance-pools` - For instance pool permissions
176
+
*`jobs` - For job permissions
177
+
*`pipelines` - For Delta Live Tables pipeline permissions
178
+
*`notebooks` - For notebook permissions (use path as `object_id`)
179
+
*`directories` - For directory permissions (use path as `object_id`)
180
+
*`workspace-files` - For workspace file permissions (use path as `object_id`)
181
+
*`registered-models` - For registered model permissions
182
+
*`experiments` - For experiment permissions
183
+
*`sql-dashboards` - For legacy SQL dashboard permissions
184
+
*`sql/warehouses` - For SQL warehouse permissions
185
+
*`queries` - For query permissions
186
+
*`alerts` - For alert permissions
187
+
*`dashboards` - For Lakeview dashboard permissions
188
+
*`repos` - For repo permissions
189
+
*`authorization` - For authorization permissions (use `tokens` or `passwords` as `object_id`)
190
+
*`serving-endpoints` - For model serving endpoint permissions
191
+
*`vector-search-endpoints` - For vector search endpoint permissions
192
+
193
+
*`object_id` - (Required) The ID or path of the object. For notebooks, directories, and workspace files, use the path (e.g., `/Shared/notebook`). For authorization, use `tokens` or `passwords`. For other objects, use the resource ID.
194
+
160
195
*`permission_level` - (Required) The permission level to grant. The available permission levels depend on the object type. Common values include `CAN_MANAGE`, `CAN_USE`, `CAN_VIEW`, `CAN_RUN`, `CAN_EDIT`, `CAN_READ`, `CAN_RESTART`, `CAN_ATTACH_TO`.
161
196
162
197
Exactly one of the following principal identifiers must be specified:
@@ -165,32 +200,6 @@ Exactly one of the following principal identifiers must be specified:
165
200
*`group_name` - (Optional) Group name to grant permissions to. Conflicts with `user_name` and `service_principal_name`.
166
201
*`service_principal_name` - (Optional) Application ID of the service principal. Conflicts with `user_name` and `group_name`.
167
202
168
-
Exactly one of the following object identifiers must be specified:
169
-
170
-
*`cluster_id` - (Optional) ID of the [databricks_cluster](cluster.md).
171
-
*`cluster_policy_id` - (Optional) ID of the [databricks_cluster_policy](cluster_policy.md).
172
-
*`instance_pool_id` - (Optional) ID of the [databricks_instance_pool](instance_pool.md).
173
-
*`job_id` - (Optional) ID of the [databricks_job](job.md).
174
-
*`pipeline_id` - (Optional) ID of the [databricks_pipeline](pipeline.md).
175
-
*`notebook_id` - (Optional) ID of the [databricks_notebook](notebook.md). Can be used when the notebook is referenced by ID.
176
-
*`notebook_path` - (Optional) Path to the [databricks_notebook](notebook.md).
177
-
*`directory_id` - (Optional) ID of the [databricks_directory](directory.md).
178
-
*`directory_path` - (Optional) Path to the [databricks_directory](directory.md).
179
-
*`workspace_file_id` - (Optional) ID of the [databricks_workspace_file](workspace_file.md).
180
-
*`workspace_file_path` - (Optional) Path to the [databricks_workspace_file](workspace_file.md).
181
-
*`registered_model_id` - (Optional) ID of the [databricks_mlflow_model](mlflow_model.md).
182
-
*`experiment_id` - (Optional) ID of the [databricks_mlflow_experiment](mlflow_experiment.md).
183
-
*`sql_dashboard_id` - (Optional) ID of the legacy [databricks_sql_dashboard](sql_dashboard.md).
184
-
*`sql_endpoint_id` - (Optional) ID of the [databricks_sql_endpoint](sql_endpoint.md).
185
-
*`sql_query_id` - (Optional) ID of the [databricks_query](query.md).
186
-
*`sql_alert_id` - (Optional) ID of the [databricks_alert](alert.md).
187
-
*`dashboard_id` - (Optional) ID of the [databricks_dashboard](dashboard.md) (Lakeview).
188
-
*`repo_id` - (Optional) ID of the [databricks_repo](repo.md).
189
-
*`repo_path` - (Optional) Path to the [databricks_repo](repo.md).
190
-
*`authorization` - (Optional) Type of authorization. Currently supports `tokens` and `passwords`.
191
-
*`serving_endpoint_id` - (Optional) ID of the [databricks_model_serving](model_serving.md) endpoint.
192
-
*`vector_search_endpoint_id` - (Optional) ID of the [databricks_vector_search_endpoint](vector_search_endpoint.md).
193
-
194
203
## Attribute Reference
195
204
196
205
In addition to all arguments above, the following attributes are exported:
0 commit comments