|
| 1 | +variable "cloud_name" { |
| 2 | + type = string |
| 3 | + description = "Cloud Name" |
| 4 | +} |
| 5 | + |
| 6 | +variable "sql_endpoint" { |
| 7 | + type = set(object({ |
| 8 | + name = string |
| 9 | + cluster_size = optional(string, "2X-Small") |
| 10 | + auto_stop_mins = optional(number, 15) |
| 11 | + max_num_clusters = optional(number, 1) |
| 12 | + enable_photon = optional(bool, false) |
| 13 | + enable_serverless_compute = optional(bool, true) |
| 14 | + spot_instance_policy = optional(string, "COST_OPTIMIZED") |
| 15 | + warehouse_type = optional(string, "PRO") |
| 16 | + key = optional(string, "user") |
| 17 | + value = optional(string, "terraform") |
| 18 | + permissions = optional(list(object({ |
| 19 | + group_name = string, |
| 20 | + permission_level = string |
| 21 | + })), []), |
| 22 | + })) |
| 23 | + description = "Set of objects with parameters to configure SQL Endpoint and assign permissions to it for certain custom groups" |
| 24 | + default = [] |
| 25 | +} |
| 26 | + |
| 27 | +variable "clusters" { |
| 28 | + type = set(object({ |
| 29 | + cluster_name = string |
| 30 | + spark_version = optional(string, "14.3.x-scala2.12") |
| 31 | + node_type_id = optional(string, "m5d.large") |
| 32 | + autotermination_minutes = optional(number, 20) |
| 33 | + min_workers = optional(number, 1) |
| 34 | + max_workers = optional(number, 2) |
| 35 | + availability = optional(string, "ON_DEMAND") |
| 36 | + zone_id = optional(string, "auto") |
| 37 | + first_on_demand = optional(number, 1) |
| 38 | + spot_bid_price_percent = optional(number, 100) |
| 39 | + data_security_mode = optional(string, "USER_ISOLATION") |
| 40 | + ebs_volume_count = optional(number, 1) |
| 41 | + ebs_volume_size = optional(number, 100) |
| 42 | + ebs_volume_type = optional(string, "GENERAL_PURPOSE_SSD") |
| 43 | + permissions = optional(list(object({ |
| 44 | + group_name = string, |
| 45 | + permission_level = string |
| 46 | + })), []), |
| 47 | + })) |
| 48 | + description = "Set of objects with parameters to configure Databricks clusters and assign permissions to it for certain custom groups" |
| 49 | + default = [] |
| 50 | +} |
| 51 | + |
| 52 | +variable "custom_config" { |
| 53 | + type = map(string) |
| 54 | + description = "Map of AD databricks workspace custom config" |
| 55 | + default = { |
| 56 | + "enableResultsDownloading" = "false", # https://docs.databricks.com/en/notebooks/notebook-outputs.html#download-results |
| 57 | + "enableNotebookTableClipboard" = "false", # https://docs.databricks.com/en/administration-guide/workspace-settings/notebooks.html#enable-users-to-copy-data-to-the-clipboard-from-notebooks |
| 58 | + "enableVerboseAuditLogs" = "true", # https://docs.databricks.com/en/administration-guide/account-settings/verbose-logs.html |
| 59 | + "enable-X-Frame-Options" = "true", |
| 60 | + "enable-X-Content-Type-Options" = "true", |
| 61 | + "enable-X-XSS-Protection" = "true", |
| 62 | + "enableDbfsFileBrowser" = "false", # https://docs.databricks.com/en/administration-guide/workspace-settings/dbfs-browser.html |
| 63 | + "enableExportNotebook" = "false", # https://docs.databricks.com/en/administration-guide/workspace-settings/notebooks.html#enable-users-to-export-notebooks |
| 64 | + "enforceUserIsolation" = "true", # https://docs.databricks.com/en/administration-guide/workspace-settings/enforce-user-isolation.html |
| 65 | + "storeInteractiveNotebookResultsInCustomerAccount" = "true", # https://docs.databricks.com/en/administration-guide/workspace-settings/notebooks.html#manage-where-notebook-results-are-stored |
| 66 | + "enableUploadDataUis" = "false", # https://docs.databricks.com/en/ingestion/add-data/index.html |
| 67 | + "enableIpAccessLists" = "true" |
| 68 | + } |
| 69 | +} |
| 70 | + |
| 71 | +variable "ip_addresses" { |
| 72 | + type = map(string) |
| 73 | + description = "A map of IP address ranges" |
| 74 | + default = { |
| 75 | + "all" = "0.0.0.0/0" |
| 76 | + } |
| 77 | +} |
| 78 | + |
| 79 | +variable "secret_scopes" { |
| 80 | + type = list(object({ |
| 81 | + scope_name = string |
| 82 | + scope_permissions = optional(set(object({ |
| 83 | + group_name = string |
| 84 | + permission_level = string |
| 85 | + }))) |
| 86 | + secrets = optional(list(object({ |
| 87 | + key = string |
| 88 | + value = string |
| 89 | + })), []) |
| 90 | + })) |
| 91 | + description = "A list of secret scopes to be created" |
| 92 | + default = [] |
| 93 | +} |
| 94 | + |
| 95 | +variable "iam_account_groups" { |
| 96 | + type = list(object({ |
| 97 | + group_name = optional(string) |
| 98 | + entitlements = optional(list(string)) |
| 99 | + })) |
| 100 | + description = "List of objects with group name and entitlements for this group" |
| 101 | + default = [] |
| 102 | +} |
0 commit comments