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

fix: CDI-2604 Databricks cluster policy permission grants not being applied correctly #563

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions databricks-cluster-policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ resource "databricks_cluster_policy" "inherited_cluster_policy" {
}

resource "databricks_permissions" "can_use_inherited_cluster_policy" {
for_each = local.inherited_cluster_policy_grantees

cluster_policy_id = databricks_cluster_policy.inherited_cluster_policy[0].id
access_control {
group_name = each.value
permission_level = "CAN_USE"

# TF provider requires a dynamic block rather than a for_each - for_each will override permissions
dynamic "access_control" {
for_each = local.inherited_cluster_policy_grantees
content {
group_name = access_control.value
permission_level = "CAN_USE"
}
}
}

Expand All @@ -53,11 +56,14 @@ resource "databricks_cluster_policy" "custom_cluster_policy" {
}

resource "databricks_permissions" "can_use_custom_cluster_policy" {
for_each = local.custom_cluster_policy_grantees

cluster_policy_id = databricks_cluster_policy.custom_cluster_policy[0].id
access_control {
group_name = each.value
permission_level = "CAN_USE"

# TF provider requires a dynamic block rather than a for_each - for_each will override permissions
dynamic "access_control" {
for_each = local.custom_cluster_policy_grantees
content {
group_name = access_control.value
permission_level = "CAN_USE"
}
}
}
Loading