Skip to content

Commit 2eb857f

Browse files
committed
upgrading output and permissions
1 parent 6cde7a7 commit 2eb857f

File tree

11 files changed

+79
-0
lines changed

11 files changed

+79
-0
lines changed

examples/clusters/1_single_node_cluster/output.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ output "cluster_id" {
33
value = module.databricks_workspace_management.cluster_id
44
}
55

6+
output "standalone_cluster_id" {
7+
description = "databricks standalone cluster id"
8+
value = module.databricks_workspace_management.single_node_cluster_id
9+
}
10+
611
output "databricks_secret_acl" {
712
description = "databricks secret acl"
813
value = module.databricks_workspace_management.databricks_secret_acl

examples/clusters/2_standard_cluster/output.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ output "cluster_id" {
33
value = module.databricks_workspace_management.cluster_id
44
}
55

6+
output "standalone_cluster_id" {
7+
description = "databricks standalone cluster id"
8+
value = module.databricks_workspace_management.single_node_cluster_id
9+
}
10+
611
output "databricks_secret_acl" {
712
description = "databricks secret acl"
813
value = module.databricks_workspace_management.databricks_secret_acl

examples/clusters/3_standard_cluster_with_auto_scaling/output.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ output "cluster_id" {
33
value = module.databricks_workspace_management.cluster_id
44
}
55

6+
output "standalone_cluster_id" {
7+
description = "databricks standalone cluster id"
8+
value = module.databricks_workspace_management.single_node_cluster_id
9+
}
10+
611
output "databricks_secret_acl" {
712
description = "databricks secret acl"
813
value = module.databricks_workspace_management.databricks_secret_acl

examples/clusters/4_cluster_with_new_cluster_policy_and_permissions/output.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ output "cluster_id" {
33
value = module.databricks_workspace_management.cluster_id
44
}
55

6+
output "standalone_cluster_id" {
7+
description = "databricks standalone cluster id"
8+
value = module.databricks_workspace_management.single_node_cluster_id
9+
}
10+
611
output "databricks_secret_acl" {
712
description = "databricks secret acl"
813
value = module.databricks_workspace_management.databricks_secret_acl

examples/clusters/5_cluster_with_existing_cluster_policy/output.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ output "cluster_id" {
33
value = module.databricks_workspace_management.cluster_id
44
}
55

6+
output "standalone_cluster_id" {
7+
description = "databricks standalone cluster id"
8+
value = module.databricks_workspace_management.single_node_cluster_id
9+
}
10+
611
output "databricks_secret_acl" {
712
description = "databricks secret acl"
813
value = module.databricks_workspace_management.databricks_secret_acl

examples/clusters/6_cluster_with_instance_pool_and_permissions/output.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ output "cluster_id" {
33
value = module.databricks_workspace_management.cluster_id
44
}
55

6+
output "standalone_cluster_id" {
7+
description = "databricks standalone cluster id"
8+
value = module.databricks_workspace_management.single_node_cluster_id
9+
}
10+
611
output "databricks_secret_acl" {
712
description = "databricks secret acl"
813
value = module.databricks_workspace_management.databricks_secret_acl

examples/clusters/7_cluster_with_instance_profile/output.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ output "cluster_id" {
33
value = module.databricks_workspace_management.cluster_id
44
}
55

6+
output "standalone_cluster_id" {
7+
description = "databricks standalone cluster id"
8+
value = module.databricks_workspace_management.single_node_cluster_id
9+
}
10+
611
output "databricks_secret_acl" {
712
description = "databricks secret acl"
813
value = module.databricks_workspace_management.databricks_secret_acl

examples/jobs/1_job_on_new_cluster_with_new_and_existing_notebooks/output.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
output "cluster_id" {
2+
description = "databricks cluster id"
3+
value = module.databricks_workspace_management.cluster_id
4+
}
5+
6+
output "standalone_cluster_id" {
7+
description = "databricks standalone cluster id"
8+
value = module.databricks_workspace_management.single_node_cluster_id
9+
}
10+
111
output "notebook_url" {
212
description = "databricks notebook url"
313
value = module.databricks_workspace_management.notebook_url

examples/jobs/2_job_on_existing_cluster_with_new_notebooks/output.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ output "notebook_url" {
22
description = "databricks notebook url"
33
value = module.databricks_workspace_management.notebook_url
44
}
5+
56
output "new_cluster_new_job_new_notebooks_job" {
67
description = "databricks job url"
78
value = module.databricks_workspace_management.new_cluster_new_job_new_notebooks_job

examples/jobs/3_job_on_existing_cluster_with_existing_notebooks/output.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ output "notebook_url" {
22
description = "databricks notebook url"
33
value = module.databricks_workspace_management.notebook_url
44
}
5+
56
output "new_cluster_new_job_new_notebooks_job" {
67
description = "databricks job url"
78
value = module.databricks_workspace_management.new_cluster_new_job_new_notebooks_job

permissions.tf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,38 @@ resource "databricks_permissions" "existing_cluster_new_job_new_notebooks" {
9797
}
9898
}
9999
# ------------------------------------------------
100+
# 3. NEW CLUSTER WITH EXITING NOTEBOOKS
101+
# ------------------------------------------------
102+
resource "databricks_permissions" "new_cluster_new_job_existing_notebooks" {
103+
for_each = (var.jobs_access_control != null && var.deploy_jobs == true && var.cluster_id == null && var.remote_notebooks != null) ? databricks_job.new_cluster_new_job_existing_notebooks : {}
104+
105+
job_id = each.value.id
106+
107+
dynamic "access_control" {
108+
for_each = var.jobs_access_control != null ? var.jobs_access_control : []
109+
content {
110+
group_name = access_control.value.group_name
111+
permission_level = access_control.value.permission_level
112+
}
113+
}
114+
}
115+
# ------------------------------------------------
116+
# 4. EXISTING CLUSTER WITH EXITING NOTEBOOKS
117+
# ------------------------------------------------
118+
resource "databricks_permissions" "existing_cluster_new_job_existing_notebooks" {
119+
for_each = (var.jobs_access_control != null && var.deploy_jobs == true && var.cluster_id != null && var.remote_notebooks != null) ? databricks_job.existing_cluster_new_job_existing_notebooks : {}
120+
121+
job_id = each.value.id
122+
123+
dynamic "access_control" {
124+
for_each = var.jobs_access_control != null ? var.jobs_access_control : []
125+
content {
126+
group_name = access_control.value.group_name
127+
permission_level = access_control.value.permission_level
128+
}
129+
}
130+
}
131+
# ------------------------------------------------
100132
# Notebooks Permissions
101133
# ------------------------------------------------
102134
resource "databricks_permissions" "notebook" {

0 commit comments

Comments
 (0)