管理數據磚使用起程拓殖工作區
本文展示了如何在一個磚工作區管理資源使用磚起程拓殖的提供者。
以下配置模塊初始化最常見的變量,databricks_spark_version,databricks_node_type,databricks_current_user。
起程拓殖{required_providers{磚={源=“磚/磚"}}}提供者“磚”{}數據“databricks_current_user”“我”{}“databricks_spark_version”“最新”{}數據“databricks_node_type”“最小”{local_disk = true}
標準功能
這些資源不需要管理權限。更多的文檔可以在專用的頁麵databricks_token,databricks_notebook,databricks_job,databricks_cluster。
資源”databricks_token”“拍”{評論=“創建從$ {abspath (path.module)}“lifetime_seconds = 3600}資源“databricks_notebook”“這”= " $ {data.databricks_current_user.me{路徑。回家}/起程拓殖PYTHON“語言= content_base64 = base64encode(< <測試結束令牌= dbutils.secrets.get (“$ {databricks_secret_scope.this.name}”,“$ {databricks_secret.token.key}”)打印(f 'This應該修訂:{牌}”)測試結束)}資源“databricks_job”“這“{name = "起程拓殖演示($ {data.databricks_current_user.me.alphanumeric})“new_cluster {num_workers = 1 spark_version = data.databricks_spark_version.latest。id node_type_id = data.databricks_node_type.smallest。id} notebook_task {notebook_path = databricks_notebook.this。路徑}email_notifications資源“databricks_cluster”“這“{}}{cluster_name =“勘探($ {data.databricks_current_user.me.alphanumeric})”spark_version = data.databricks_spark_version.latest。id instance_pool_id = databricks_instance_pool.smallest_nodes。id autotermination_minutes = 20自動定量{min_workers = 1 max_workers = 10}} {value = databricks_notebook.this“notebook_url”輸出。url} {value = databricks_job.this“job_url”輸出。url}
工作區安全
安全管理需要管理權限。更多的文檔可以在專用的頁麵databricks_secret_acl,databricks_group,databricks_user,databricks_group_member,databricks_permissions。
資源”databricks_secret_acl”“觀眾”{= databricks_group.spectators校長。display_name範圍= databricks_secret_scope.this.name許可=“讀”}資源“databricks_group”“觀眾”{display_name =“觀眾($ {data.databricks_current_user.me.alphanumeric}) "} resource "databricks_user" "dummy" { user_name = "dummy+${data.databricks_current_user.me.alphanumeric}@example.com" display_name = "Dummy ${data.databricks_current_user.me.alphanumeric}" } resource "databricks_group_member" "a" { group_id = databricks_group.spectators.id member_id = databricks_user.dummy.id } resource "databricks_permissions" "notebook" { notebook_path = databricks_notebook.this.id access_control { user_name = databricks_user.dummy.user_name permission_level = "CAN_RUN" } access_control { group_name = databricks_group.spectators.display_name permission_level = "CAN_READ" } } resource "databricks_permissions" "job" { job_id = databricks_job.this.id access_control { user_name = databricks_user.dummy.user_name permission_level = "IS_OWNER" } access_control { group_name = databricks_group.spectators.display_name permission_level = "CAN_MANAGE_RUN" } } resource "databricks_permissions" "cluster" { cluster_id = databricks_cluster.this.id access_control { user_name = databricks_user.dummy.user_name permission_level = "CAN_RESTART" } access_control { group_name = databricks_group.spectators.display_name permission_level = "CAN_ATTACH_TO" } } resource "databricks_permissions" "policy" { cluster_policy_id = databricks_cluster_policy.this.id access_control { group_name = databricks_group.spectators.display_name permission_level = "CAN_USE" } } resource "databricks_permissions" "pool" { instance_pool_id = databricks_instance_pool.smallest_nodes.id access_control { group_name = databricks_group.spectators.display_name permission_level = "CAN_ATTACH_TO" } }
存儲
根據您的喜好和需求,你可以
管理JAR、車輪和卵子庫通過databricks_dbfs_file資源。
在DBFS列表條目databricks_dbfs_file_paths數據源。
小文件的內容databricks_dbfs_file數據源。
高級配置
更多的文檔可以在專門的頁麵databricks_workspace_conf。
數據“http”“我”{url = " https://ifconfig。我“}資源“databricks_workspace_conf”“這”{custom_config = {“enableIpAccessLists”: "真正的"}}