diff --git a/README.md b/README.md index 85c9412..3548c60 100644 --- a/README.md +++ b/README.md @@ -354,13 +354,13 @@ module "databricks_runtime" { | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >=1.3 | -| [databricks](#requirement\_databricks) | ~>1.0 | +| [databricks](#requirement\_databricks) | >=1.85.0 | ## Providers | Name | Version | |------|---------| -| [databricks](#provider\_databricks) | ~>1.0 | +| [databricks](#provider\_databricks) | >=1.85.0 | ## Modules @@ -373,6 +373,7 @@ No modules. | [databricks_cluster.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster) | resource | | [databricks_cluster_policy.overrides](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster_policy) | resource | | [databricks_cluster_policy.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster_policy) | resource | +| [databricks_database_instance.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/database_instance) | resource | | [databricks_entitlements.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/entitlements) | resource | | [databricks_group.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group) | resource | | [databricks_ip_access_list.allowed_list](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/ip_access_list) | resource | @@ -406,6 +407,7 @@ No modules. | [iam\_workspace\_groups](#input\_iam\_workspace\_groups) | Used to create workspace group. Map of group name and its parameters, such as users and service principals added to the group. Also possible to configure group entitlements. |
map(object({
user = optional(list(string))
service_principal = optional(list(string))
entitlements = optional(list(string))
}))
| `{}` | no | | [ip\_addresses](#input\_ip\_addresses) | A map of IP address ranges | `map(string)` |
{
"all": "0.0.0.0/0"
}
| no | | [key\_vault\_secret\_scope](#input\_key\_vault\_secret\_scope) | Object with Azure Key Vault parameters required for creation of Azure-backed Databricks Secret scope |
list(object({
name = string
key_vault_id = string
dns_name = string
tenant_id = string
}))
| `[]` | no | +| [lakebase\_instance](#input\_lakebase\_instance) | Map of objects with parameters to configure and deploy OLTP database instances in Databricks.
To deploy and use an OLTP database instance in Databricks:
- You must be a Databricks workspace owner.
- A Databricks workspace must already be deployed in your cloud environment (e.g., AWS or Azure).
- The workspace must be on the Premium plan or above.
- You must enable the "Lakebase: Managed Postgres OLTP Database" feature in the Preview features section.
- Database instances can only be deleted manually through the Databricks UI or using the Databricks CLI with the --purge option. |
map(object({
name = string
capacity = optional(string, "CU_1")
node_count = optional(number, 1)
enable_readable_secondaries = optional(bool, false)
retention_window_in_days = optional(number, 7)
}))
| `{}` | no | | [mount\_configuration](#input\_mount\_configuration) | Configuration for mounting storage, including only service principal details |
object({
service_principal = object({
client_id = string
client_secret = string
tenant_id = string
})
})
|
{
"service_principal": {
"client_id": null,
"client_secret": null,
"tenant_id": null
}
}
| no | | [mount\_enabled](#input\_mount\_enabled) | Boolean flag that determines whether mount point for storage account filesystem is created | `bool` | `false` | no | | [mountpoints](#input\_mountpoints) | Mountpoints for databricks |
map(object({
storage_account_name = string
container_name = string
}))
| `{}` | no | diff --git a/lakebase.tf b/lakebase.tf new file mode 100644 index 0000000..bf54323 --- /dev/null +++ b/lakebase.tf @@ -0,0 +1,9 @@ +resource "databricks_database_instance" "this" { + for_each = var.lakebase_instance + + name = each.value.name + capacity = each.value.capacity + node_count = each.value.node_count + enable_readable_secondaries = each.value.enable_readable_secondaries + retention_window_in_days = each.value.retention_window_in_days +} diff --git a/variables.tf b/variables.tf index daa0954..15e4f59 100644 --- a/variables.tf +++ b/variables.tf @@ -272,3 +272,23 @@ variable "ip_addresses" { "all" = "0.0.0.0/0" } } + +variable "lakebase_instance" { + type = map(object({ + name = string + capacity = optional(string, "CU_1") + node_count = optional(number, 1) + enable_readable_secondaries = optional(bool, false) + retention_window_in_days = optional(number, 7) + })) + default = {} + description = <