Skip to content
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

[Feature] Add CAN_MONITOR_ONLY permission for SQL warehouse #4464

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jiabin-hu
Copy link

@jiabin-hu jiabin-hu commented Feb 3, 2025

Changes

Add CAN_MONITOR_ONLY permission for SQL warehouse

Tests

Locally installed and tested. See the following output:

% terraform apply -var="databricks_host=REDACTED"  -var="databricks_token=REDACTED"
databricks_sql_endpoint.sql_warehouse: Refreshing state... [id=96a8c7fd8ce338f6]
databricks_permissions.sql_warehouse_usage: Refreshing state... [id=/sql/warehouses/96a8c7fd8ce338f6]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # databricks_permissions.sql_warehouse_usage will be updated in-place
  ~ resource "databricks_permissions" "sql_warehouse_usage" {
        id              = "/sql/warehouses/96a8c7fd8ce338f6"
        # (2 unchanged attributes hidden)

      - access_control {
          - permission_level = "CAN_MONITOR" -> null
          - user_name        = "REDACTED" -> null
        }
      + access_control {
          + permission_level = "CAN_MONITOR_ONLY"
          + user_name        = "REDACTED"
        }
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

databricks_permissions.sql_warehouse_usage: Modifying... [id=/sql/warehouses/96a8c7fd8ce338f6]
databricks_permissions.sql_warehouse_usage: Modifications complete after 3s [id=/sql/warehouses/96a8c7fd8ce338f6]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Outputs:

warehouse_id = "96a8c7fd8ce338f6"
  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • [no] using Go SDK
  • using TF Plugin Framework

@jiabin-hu jiabin-hu requested review from a team as code owners February 3, 2025 23:39
@jiabin-hu jiabin-hu requested review from parthban-db and removed request for a team February 3, 2025 23:39
NEXT_CHANGELOG.md Outdated Show resolved Hide resolved
permissions/permission_definitions.go Outdated Show resolved Hide resolved
@alexott alexott changed the title Add CAN_MONITOR_ONLY permission for SQL warehouse [Feature] Add CAN_MONITOR_ONLY permission for SQL warehouse Feb 4, 2025
@alexott alexott changed the title [Feature] Add CAN_MONITOR_ONLY permission for SQL warehouse [Feature] Add CAN_MONITOR_ONLY permission for SQL warehouse Feb 4, 2025
@alexott alexott temporarily deployed to test-trigger-is February 4, 2025 15:58 — with GitHub Actions Inactive
@alexott alexott temporarily deployed to test-trigger-is February 6, 2025 02:54 — with GitHub Actions Inactive
Copy link

github-actions bot commented Feb 6, 2025

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 4464
  • Commit SHA: c32007a4a7711ca49c97751e36518aaee23ee92d

Checks will be approved automatically on success.

@alexott
Copy link
Contributor

alexott commented Feb 6, 2025

This is a private preview feature so it's failing on integration tests

@jiabin-hu
Copy link
Author

This is a private preview feature so it's failing on integration tests

Yes it's in private preview now, but going on public preview soon. I can hold off the PR until PuPr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants