Skip to content

Commit 64b8a18

Browse files
authored
feat!: add support for settings.sql_server_audit_config setting
1 parent f96f71e commit 64b8a18

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

modules/mssql/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ The following dependency must be available for SQL Server module:
3939
| random\_instance\_name | Sets random suffix at the end of the Cloud SQL resource name | `bool` | `false` | no |
4040
| region | The region of the Cloud SQL resources | `string` | `"us-central1"` | no |
4141
| 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 |
42+
| sql\_server\_audit\_config | Active domain that the SQL instance will join. | `map(string)` | `{}` | no |
4243
| tier | The tier for the master instance. | `string` | `"db-custom-2-3840"` | no |
4344
| update\_timeout | The optional timeout that is applied to limit long database updates. | `string` | `"15m"` | no |
4445
| user\_labels | The key/value labels for the master instances. | `map(string)` | `{}` | no |

modules/mssql/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ resource "google_sql_database_instance" "default" {
110110
}
111111
}
112112

113+
dynamic "sql_server_audit_config" {
114+
for_each = var.sql_server_audit_config
115+
content {
116+
bucket = lookup(var.sql_server_audit_config, "bucket", null)
117+
upload_interval = lookup(var.sql_server_audit_config, "upload_interval", null)
118+
retention_interval = lookup(var.sql_server_audit_config, "retention_interval", null)
119+
}
120+
}
121+
113122
user_labels = var.user_labels
114123

115124
location_preference {

modules/mssql/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ variable "active_directory_config" {
130130
default = {}
131131
}
132132

133+
variable "sql_server_audit_config" {
134+
description = "Active domain that the SQL instance will join."
135+
type = map(string)
136+
default = {}
137+
}
138+
133139
variable "user_labels" {
134140
description = "The key/value labels for the master instances."
135141
type = map(string)

modules/mssql/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ terraform {
2020

2121
google-beta = {
2222
source = "hashicorp/google-beta"
23-
version = ">= 4.22.0, < 5.0"
23+
version = ">= 4.28.0, < 5.0"
2424
}
2525
}
2626

0 commit comments

Comments
 (0)