管理數據磚使用起程拓殖工作區
以下配置模塊初始化最常見的變量,databricks_spark_version,databricks_node_type,databricks_current_user。
起程拓殖{required_providers{磚={源=“磚/磚"}}}提供者“磚”{}數據“databricks_current_user”“我”{}“databricks_spark_version”“最新”{}數據“databricks_node_type”“最小”{local_disk = true}
標準功能
這些資源不需要管理權限。更多的文檔可以在專用的頁麵databricks_secret_scope,databricks_token,databricks_secret,databricks_notebook,databricks_job,databricks_cluster,databricks_cluster_policy,databricks_instance_pool。
資源“databricks_secret_scope””這個“{name = " $ {data.databricks_current_user.me演示。字母數字}}資源“databricks_token”“拍”{評論=“創建從$ {abspath (path.module)}“lifetime_seconds = 3600}資源”databricks_secret”“令牌”{string_value = databricks_token.pat。token_value範圍= databricks_secret_scope.this.name關鍵資源“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}}資源“databricks_cluster_policy”“這“{name = "最小($ {data.databricks_current_user.me.alphanumeric})”定義= jsonencode ({“dbus_per_hour”:{“類型”:“範圍”、“執行”:10},“autotermination_minutes”:{“類型”:“固定”,“價值”:20,“隱藏”:真正}})}資源“databricks_instance_pool”“smallest_nodes”{instance_pool_name =“最小的節點($ {data.databricks_current_user.me.alphanumeric})”min_idle_instances = 0 max_capacity = 30 node_type_id = data.databricks_node_type.smallest。(data.databricks_spark_version.latest id preloaded_spark_versions =。id] idle_instance_autotermination_minutes = 20} {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數據源。
AWS存儲使用databricks_aws_s3_mount資源。
高級配置
更多的文檔可以在專門的頁麵databricks_workspace_conf和databricks_ip_access_list資源。
數據“http”“我”{url = " https://ifconfig。我“}資源“databricks_workspace_conf”“這”{custom_config = {“enableIpAccessLists”:“true”}}資源”databricks_ip_access_list only_me”{label = " $ {data.http.my。身體}是允許訪問工作區”list_type = "允許" ip_addresses = [" $ {data.http.my。身體}/ 32 "][databricks_workspace_conf depends_on =。這]}