Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
CDA0 committed Jan 20, 2024
1 parent 419f0d0 commit 945b7e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
8 changes: 4 additions & 4 deletions modules/mssql-server/src/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ resource "azurerm_mssql_server" "main" {

minimum_tls_version = var.minimum_tls_version
version = var.sql_server_version
administrator_login = var.azuread_authentication_only ? null : var.administrator_login
administrator_login_password = var.azuread_authentication_only ? null : var.administrator_password
administrator_login = var.administrator_login
administrator_login_password = var.administrator_password

identity {
type = "SystemAssigned"
}

dynamic "azuread_administrator" {
for_each = var.azuread_authentication_only ? [{}] : []
for_each = var.azuread_administrator != null ? [{}] : []
content {
azuread_authentication_only = var.azuread_authentication_only
azuread_authentication_only = var.azuread_administrator.azuread_authentication_only
login_username = var.azuread_administrator.login_username
object_id = var.azuread_administrator.object_id
}
Expand Down
17 changes: 5 additions & 12 deletions modules/mssql-server/src/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@ variable "administrator_password" {

variable "administrator_login" {
type = string
default = "sqladmin"
}

variable "azuread_authentication_only" {
type = bool
default = true
default = null
}

variable "azuread_administrator" {
type = object({
login_username = string
object_id = string
azuread_authentication_only = bool
login_username = string
object_id = string
})
default = {
login_username = null
object_id = null
}
default = null
}

variable "environment" {
Expand Down

0 comments on commit 945b7e3

Please sign in to comment.