Cluser.tf file
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 2.33"
}
databricks = {
source = "databrickslabs/databricks"
version = "~> 0.5"
}
random = {
source = "hashicorp/random"
version = "~> 2.2"
}
}
}
resource “databricks_cluster” “cluster1” {
cluster_name = var.cluster1name #“Cluster-1”
spark_version = var.spark_version #data.databricks_spark_version.latest_lts.id
node_type_id = var.node_type_id #data.databricks_node_type.smallest.id
autotermination_minutes = 15
autoscale {
min_workers = 1
max_workers = 3
}
library {
pypi {
package = "pyodbc"
}
}
library {
pypi {
package = "databricks-cli"
}
}
}
resource “databricks_notebook” “notebook1” {
content_base64 = base64encode(“print(‘Welcome to your Python notebook1 App1’)”)
path = var.notebook_path1
language = “PYTHON”
format = “SOURCE”
}
resource “databricks_notebook” “notebook2” {
content_base64 = base64encode(“print(‘Welcome to your Python notebook2 App2’)”)
path = var.notebook_path2
language = “PYTHON”
format = “SOURCE”
}