diff --git a/modules/mssql/README.md b/modules/mssql/README.md index e4aa824b..d25d99d6 100644 --- a/modules/mssql/README.md +++ b/modules/mssql/README.md @@ -10,6 +10,7 @@ The following dependency must be available for SQL Server module: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | activation\_policy | The activation policy for the master instance.Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`. | `string` | `"ALWAYS"` | no | +| active\_directory\_config | Active domain that the SQL instance will join. | `map(string)` | `{}` | no | | additional\_databases | A list of databases to be created in your cluster |
list(object({| `[]` | no | | additional\_users | A list of users to be created in your cluster |
name = string
charset = string
collation = string
}))
list(object({| `[]` | no | | availability\_type | The availability type for the master instance.This is only used to set up high availability for the MSSQL instance. Can be either `ZONAL` or `REGIONAL`. | `string` | `"ZONAL"` | no | diff --git a/modules/mssql/main.tf b/modules/mssql/main.tf index 18511ceb..96b53854 100644 --- a/modules/mssql/main.tf +++ b/modules/mssql/main.tf @@ -102,6 +102,12 @@ resource "google_sql_database_instance" "default" { value = lookup(database_flags.value, "value", null) } } + dynamic "active_directory_config" { + for_each = var.active_directory_config + content { + domain = lookup(var.active_directory_config, "domain", null) + } + } user_labels = var.user_labels diff --git a/modules/mssql/variables.tf b/modules/mssql/variables.tf index 29f24d8d..09541516 100644 --- a/modules/mssql/variables.tf +++ b/modules/mssql/variables.tf @@ -118,6 +118,12 @@ variable "database_flags" { default = [] } +variable "active_directory_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 94148e58..ca76cf2a 100644 --- a/modules/mssql/versions.tf +++ b/modules/mssql/versions.tf @@ -20,7 +20,7 @@ terraform { google-beta = { source = "hashicorp/google-beta" - version = ">= 4.4.0, < 5.0" + version = ">= 4.22.0, < 5.0" } }
name = string
password = string
}))