Skip to content

Instantly share code, notes, and snippets.

@olliefr
Created April 22, 2025 16:50
Show Gist options
  • Save olliefr/0d63a3958552ff42d94bf466e2a41cbd to your computer and use it in GitHub Desktop.
Save olliefr/0d63a3958552ff42d94bf466e2a41cbd to your computer and use it in GitHub Desktop.
Databricks: configure verbose Audit Logs with Terraform
The configuration uses default credentials as set up by:
databricks auth login --host https://9999487995419999.1.gcp.databricks.com/
terraform {
required_providers {
databricks = {
source = "databricks/databricks"
version = "1.74.0"
}
}
required_version = "~> 1.11.3"
}
variable "databricks_workspace" {
type = number
description = "Workspace ID (number)"
nullable = false
default = 9999487995419999
}
variable "enable_verbose_audit_logs" {
type = bool
description = "Enable verbose Audit Logs on the Workspace"
nullable = false
default = true
}
provider "databricks" {
host = "https://${var.databricks_workspace}.1.gcp.databricks.com"
}
resource "databricks_workspace_conf" "main" {
custom_config = {
"enableVerboseAuditLogs" : var.enable_verbose_audit_logs
}
}
data "databricks_current_config" "main" {}
data "databricks_current_metastore" "main" {}
data "databricks_current_user" "me" {}
output "databricks_current_config" {
value = data.databricks_current_config.main
}
output "current_metastore_info" {
value = data.databricks_current_metastore.main.metastore_info
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment