Skip to content

Commit ed27c28

Browse files
authored
Improve usage of adb-vnet-injection example (#105)
Changes include: * Document all input variables for this example * Allow to specify tags for resources without modifying main code
1 parent 20df1c4 commit ed27c28

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

examples/adb-vnet-injection/main.tf

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@ resource "azurerm_resource_group" "this" {
2525
}
2626

2727
locals {
28-
// dltp - databricks labs terraform provider
2928
prefix = join("-", [var.workspace_prefix, "${random_string.naming.result}"])
3029
location = var.rglocation
3130
dbfsname = join("", [var.dbfs_prefix, "${random_string.naming.result}"]) // dbfs name must not have special chars
3231

3332
// tags that are propagated down to all resources
34-
tags = {
33+
tags = merge({
3534
Environment = "Testing"
3635
Epoch = random_string.naming.result
37-
}
36+
}, var.tags)
3837
}
3938

4039

+29-14
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,49 @@
11
variable "no_public_ip" {
2-
type = bool
3-
default = true
2+
type = bool
3+
default = true
4+
description = "If Secure Cluster Connectivity (No Public IP) should be enabled. Default: true"
45
}
56

67
variable "rglocation" {
7-
type = string
8-
default = "southeastasia"
8+
type = string
9+
default = "southeastasia"
10+
description = "Location of resource group to create"
911
}
1012

1113
variable "dbfs_prefix" {
12-
type = string
13-
default = "dbfs"
14+
type = string
15+
default = "dbfs"
16+
description = "Name prefix for DBFS Root Storage account"
1417
}
1518

1619
variable "node_type" {
17-
type = string
18-
default = "Standard_DS3_v2"
20+
type = string
21+
default = "Standard_DS3_v2"
22+
description = "Node type for created cluster"
1923
}
2024

2125
variable "workspace_prefix" {
22-
type = string
23-
default = "adb"
26+
type = string
27+
default = "adb"
28+
description = "Name prefix for Azure Databricks workspace"
2429
}
2530

2631
variable "global_auto_termination_minute" {
27-
type = number
28-
default = 30
32+
type = number
33+
default = 30
34+
description = "Auto-termination time for created cluster"
2935
}
3036

3137
variable "cidr" {
32-
type = string
33-
default = "10.179.0.0/20"
38+
type = string
39+
default = "10.179.0.0/20"
40+
description = "Network range for created VNet"
3441
}
42+
43+
variable "tags" {
44+
type = map(string)
45+
description = "Optional tags to add to resources"
46+
default = {}
47+
}
48+
49+

0 commit comments

Comments
 (0)