Skip to content

Commit 449f1a2

Browse files
vponnambharathkkb
andauthored
feat!: add support for settings.active_directory_config for SQL module (#305)
* add support for settings.active_directory_config for SQL module * make active_directory_config a map(string) * fix linting issues * bump min provider version to v4.22.0 Co-authored-by: Bharath KKB <[email protected]>
1 parent 4e2cb87 commit 449f1a2

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

modules/mssql/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The following dependency must be available for SQL Server module:
1010
| Name | Description | Type | Default | Required |
1111
|------|-------------|------|---------|:--------:|
1212
| activation\_policy | The activation policy for the master instance.Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`. | `string` | `"ALWAYS"` | no |
13+
| active\_directory\_config | Active domain that the SQL instance will join. | `map(string)` | `{}` | no |
1314
| additional\_databases | A list of databases to be created in your cluster | <pre>list(object({<br> name = string<br> charset = string<br> collation = string<br> }))</pre> | `[]` | no |
1415
| additional\_users | A list of users to be created in your cluster | <pre>list(object({<br> name = string<br> password = string<br> }))</pre> | `[]` | no |
1516
| 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 |

modules/mssql/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ resource "google_sql_database_instance" "default" {
102102
value = lookup(database_flags.value, "value", null)
103103
}
104104
}
105+
dynamic "active_directory_config" {
106+
for_each = var.active_directory_config
107+
content {
108+
domain = lookup(var.active_directory_config, "domain", null)
109+
}
110+
}
105111

106112
user_labels = var.user_labels
107113

modules/mssql/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ variable "database_flags" {
118118
default = []
119119
}
120120

121+
variable "active_directory_config" {
122+
description = "Active domain that the SQL instance will join."
123+
type = map(string)
124+
default = {}
125+
}
126+
121127
variable "user_labels" {
122128
description = "The key/value labels for the master instances."
123129
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.4.0, < 5.0"
23+
version = ">= 4.22.0, < 5.0"
2424
}
2525
}
2626

0 commit comments

Comments
 (0)