-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Endpoint Permissions - Unable to remove permissions #1163
Comments
https://github.com/databrickslabs/terraform-provider-databricks/blame/master/permissions/resource_permissions.go#L135-L140 we're using PATCH for historical reasons. we'll look into it, given the cycles allowing. |
nfx
added a commit
that referenced
this issue
Mar 10, 2022
Use correct HTTP verb for `databricks_permissions` on `databricks_sql_endpoint`. Authorized user, assumingly part of `admins` group, is no longer sending `CAN_MANAGE` permission in the HTTP PUT request. Fixes #1163
nfx
added a commit
that referenced
this issue
Mar 10, 2022
Use correct HTTP verb for `databricks_permissions` on `databricks_sql_endpoint`. Authorized user, assumingly part of `admins` group, is no longer sending `CAN_MANAGE` permission in the HTTP PUT request. Fixes #1163
nfx
added a commit
that referenced
this issue
Mar 11, 2022
* Use correct verb for permissions on SQL Endpoint Use correct HTTP verb for `databricks_permissions` on `databricks_sql_endpoint`. Authorized user, assumingly part of `admins` group, is no longer sending `CAN_MANAGE` permission in the HTTP PUT request. Fixes #1163
Merged
michael-berk
pushed a commit
to michael-berk/terraform-provider-databricks
that referenced
this issue
Feb 15, 2023
* Use correct verb for permissions on SQL Endpoint Use correct HTTP verb for `databricks_permissions` on `databricks_sql_endpoint`. Authorized user, assumingly part of `admins` group, is no longer sending `CAN_MANAGE` permission in the HTTP PUT request. Fixes databricks#1163
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
databricks_permissions
resource doesn't remove permissions when applied to SQL EndpointsConfiguration
The following configuration comments out GROUP_TO_REMOVE. On Terarform apply, the Group should be removed from SQL endpoint permissions
Terarform apply shows changes successfully applied:
Expected Behaviour
After a Terraform apply, GROUP_TO_REMOVE is removed from permissions on Databricks SQL Endpoint
Actual Behaviour
GROUP_TO_REMOVE doesn't get removed on the Databricks SQL Endpoint. Performing a subsequent plan/apply shows same changes need to be made
Steps to reproduce
Apply a databricks_permissions resource on an sql endpoint with an initial set of group permissions. Remove a group permission and run a Terraform apply. The group is not removed.
Terraform and provider versions
Terarform Version
1.0.11
Databricks Provider
0.5.2
Important Factoids
Looking at the DEBUG logs, it seems a PATCH API call is done. Reading the Databricks API docs, shouldn't that be a PUT API call, so that user permisions are overwritten?
PATCH /permissions/sql/endpoints/{endpoint_id}
https://docs.databricks.com/dev-tools/api/latest/permissions.html#operation/set-sqlendpoint-permissions
Grant SQL endpoint permissions for one or more users, groups, or service principals.
This request only grants (adds) permissions. To revoke, use the replace all SQL endpoint permissions operation.
PUT /permissions/sql/endpoints/{endpoint_id}
https://docs.databricks.com/dev-tools/api/latest/permissions.html#operation/update-all-sqlendpoint-permissions
Update all permissions for a specific SQL endpoint, specifying all users, groups or service principal.
WARNING: This request overwrites all existing direct (non-inherited) permissions on the SQL endpoint and replaces it with the new permissions specified in the request body.
The text was updated successfully, but these errors were encountered: