Skip to content

Commit

Permalink
Add nullable argument to some bool type variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Jun 23, 2022
1 parent 617c30e commit 4e2a5a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ resource "azurerm_kubernetes_cluster" "main" {
dynamic "oms_agent" {
for_each = var.enable_log_analytics_workspace ? ["oms_agent"] : []
content {
log_analytics_workspace_id = var.enable_log_analytics_workspace ? azurerm_log_analytics_workspace.main[0].id : null
log_analytics_workspace_id = azurerm_log_analytics_workspace.main[0].id
}
}

dynamic "ingress_application_gateway" {
for_each = var.enable_ingress_application_gateway == null ? [] : ["ingress_application_gateway"]
for_each = var.enable_ingress_application_gateway ? ["ingress_application_gateway"] : []
content {
gateway_id = var.ingress_application_gateway_id
gateway_name = var.ingress_application_gateway_name
Expand Down
11 changes: 9 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ variable "enable_log_analytics_workspace" {
type = bool
description = "Enable the creation of azurerm_log_analytics_workspace and azurerm_log_analytics_solution or not"
default = true
nullable = false
}

variable "vnet_subnet_id" {
Expand All @@ -102,6 +103,7 @@ variable "os_disk_type" {
description = "The type of disk which should be used for the Operating System. Possible values are `Ephemeral` and `Managed`. Defaults to `Managed`. Changing this forces a new resource to be created."
type = string
default = "Managed"
nullable = false
}

variable "private_cluster_enabled" {
Expand Down Expand Up @@ -132,12 +134,14 @@ variable "enable_role_based_access_control" {
description = "Enable Role Based Access Control."
type = bool
default = false
nullable = false
}

variable "rbac_aad_managed" {
description = "Is the Azure Active Directory integration Managed, meaning that Azure will create/manage the Service Principal used for integration."
type = bool
default = false
nullable = false
}

variable "rbac_aad_admin_group_object_ids" {
Expand Down Expand Up @@ -168,6 +172,7 @@ variable "network_plugin" {
description = "Network plugin to use for networking."
type = string
default = "kubenet"
nullable = false
}

variable "network_policy" {
Expand Down Expand Up @@ -240,6 +245,7 @@ variable "agents_pool_name" {
description = "The default Azure AKS agentpool (nodepool) name."
type = string
default = "nodepool"
nullable = false
}

variable "enable_node_public_ip" {
Expand Down Expand Up @@ -281,7 +287,8 @@ variable "agents_max_pods" {
variable "enable_ingress_application_gateway" {
description = "Whether to deploy the Application Gateway ingress controller to this Kubernetes Cluster?"
type = bool
default = null
default = false
nullable = false
}

variable "ingress_application_gateway_id" {
Expand Down Expand Up @@ -327,7 +334,7 @@ variable "enable_host_encryption" {
}

variable "node_resource_group" {
description = "The auto-generated Resource Group which contains the resources for this Managed Kubernetes Cluster."
description = "The auto-generated Resource Group which contains the resources for this Managed Kubernetes Cluster. Changing this forces a new resource to be created."
type = string
default = null
}

0 comments on commit 4e2a5a5

Please sign in to comment.