Skip to content

Commit

Permalink
feat!: add support for settings.active_directory_config for SQL module (
Browse files Browse the repository at this point in the history
#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 <bharathkrishnakb@gmail.com>
  • Loading branch information
vponnam and bharathkkb authored May 25, 2022
1 parent 4e2cb87 commit 449f1a2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/mssql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | <pre>list(object({<br> name = string<br> charset = string<br> collation = string<br> }))</pre> | `[]` | no |
| additional\_users | A list of users to be created in your cluster | <pre>list(object({<br> name = string<br> password = string<br> }))</pre> | `[]` | 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 |
Expand Down
6 changes: 6 additions & 0 deletions modules/mssql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions modules/mssql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion modules/mssql/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ terraform {

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

Expand Down

0 comments on commit 449f1a2

Please sign in to comment.