-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathworkspace-security.tf
29 lines (22 loc) · 976 Bytes
/
workspace-security.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
resource "databricks_secret_acl" "spectators" {
count = var.databricks_username != "" && var.create_group != false ? 1 : 0
principal = join("", databricks_group.this.*.display_name)
scope = "${var.teamid}-${var.prjid}"
permission = "READ"
}
resource "databricks_user" "users" {
count = var.databricks_username != "" && var.create_user != false ? 1 : 0
user_name = local.databricks_username
display_name = local.databricks_displayname
}
resource "databricks_group" "this" {
count = var.create_group != false ? 1 : 0
display_name = "${var.teamid}-${var.prjid} (Terraform managed)"
allow_cluster_create = var.allow_cluster_create
allow_instance_pool_create = var.allow_instance_pool_create
}
resource "databricks_group_member" "group_members" {
count = var.create_user != false && var.create_group != false ? 1 : 0
group_id = join("", databricks_group.this.*.id)
member_id = join("", databricks_user.users.*.id)
}