diff --git a/modules/mssql/README.md b/modules/mssql/README.md index 41d17600..c7a35fed 100644 --- a/modules/mssql/README.md +++ b/modules/mssql/README.md @@ -39,6 +39,7 @@ The following dependency must be available for SQL Server module: | random\_instance\_name | Sets random suffix at the end of the Cloud SQL resource name | `bool` | `false` | no | | region | The region of the Cloud SQL resources | `string` | `"us-central1"` | no | | root\_password | MSSERVER password for the root user. If not set, a random one will be generated and available in the root\_password output variable. | `string` | `""` | no | +| sql\_server\_audit\_config | Active domain that the SQL instance will join. | `map(string)` | `{}` | no | | tier | The tier for the master instance. | `string` | `"db-custom-2-3840"` | no | | update\_timeout | The optional timeout that is applied to limit long database updates. | `string` | `"15m"` | no | | user\_labels | The key/value labels for the master instances. | `map(string)` | `{}` | no | diff --git a/modules/mssql/main.tf b/modules/mssql/main.tf index b929b0b8..7418651a 100644 --- a/modules/mssql/main.tf +++ b/modules/mssql/main.tf @@ -110,6 +110,15 @@ resource "google_sql_database_instance" "default" { } } + dynamic "sql_server_audit_config" { + for_each = var.sql_server_audit_config + content { + bucket = lookup(var.sql_server_audit_config, "bucket", null) + upload_interval = lookup(var.sql_server_audit_config, "upload_interval", null) + retention_interval = lookup(var.sql_server_audit_config, "retention_interval", null) + } + } + user_labels = var.user_labels location_preference { diff --git a/modules/mssql/variables.tf b/modules/mssql/variables.tf index 0d7f62db..ea1501a3 100644 --- a/modules/mssql/variables.tf +++ b/modules/mssql/variables.tf @@ -130,6 +130,12 @@ variable "active_directory_config" { default = {} } +variable "sql_server_audit_config" { + description = "Active domain that the SQL instance will join." + type = map(string) + default = {} +} + variable "user_labels" { description = "The key/value labels for the master instances." type = map(string) diff --git a/modules/mssql/versions.tf b/modules/mssql/versions.tf index c9c24155..5a332dc5 100644 --- a/modules/mssql/versions.tf +++ b/modules/mssql/versions.tf @@ -20,7 +20,7 @@ terraform { google-beta = { source = "hashicorp/google-beta" - version = ">= 4.22.0, < 5.0" + version = ">= 4.28.0, < 5.0" } }