Skip to content

Commit

Permalink
feat!: add support for settings.sql_server_audit_config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
vponnam committed Aug 15, 2022
1 parent f96f71e commit 64b8a18
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/mssql/README.md
Expand Up @@ -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 |
Expand Down
9 changes: 9 additions & 0 deletions modules/mssql/main.tf
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions modules/mssql/variables.tf
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion modules/mssql/versions.tf
Expand Up @@ -20,7 +20,7 @@ terraform {

google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.22.0, < 5.0"
version = ">= 4.28.0, < 5.0"
}
}

Expand Down

0 comments on commit 64b8a18

Please sign in to comment.