Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module "ssh-key" {
resource "azurerm_kubernetes_cluster" "main" {
name = var.cluster_name == null ? "${var.prefix}-aks" : var.cluster_name
kubernetes_version = var.kubernetes_version
location = data.azurerm_resource_group.main.location
location = coalesce(var.location, data.azurerm_resource_group.main.location)
resource_group_name = data.azurerm_resource_group.main.name
node_resource_group = var.node_resource_group
dns_prefix = var.prefix
Expand Down Expand Up @@ -156,7 +156,7 @@ resource "azurerm_kubernetes_cluster" "main" {
resource "azurerm_log_analytics_workspace" "main" {
count = var.enable_log_analytics_workspace ? 1 : 0
name = var.cluster_log_analytics_workspace_name == null ? "${var.prefix}-workspace" : var.cluster_log_analytics_workspace_name
location = data.azurerm_resource_group.main.location
location = coalesce(var.location, data.azurerm_resource_group.main.location)
resource_group_name = var.resource_group_name
sku = var.log_analytics_workspace_sku
retention_in_days = var.log_retention_in_days
Expand All @@ -167,7 +167,7 @@ resource "azurerm_log_analytics_workspace" "main" {
resource "azurerm_log_analytics_solution" "main" {
count = var.enable_log_analytics_workspace ? 1 : 0
solution_name = "ContainerInsights"
location = data.azurerm_resource_group.main.location
location = coalesce(var.location, data.azurerm_resource_group.main.location)
resource_group_name = var.resource_group_name
workspace_resource_id = azurerm_log_analytics_workspace.main[0].id
workspace_name = azurerm_log_analytics_workspace.main[0].name
Expand Down
4 changes: 2 additions & 2 deletions test/fixture/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ module "aks" {
"Agent" : "agentTag"
}

enable_ingress_application_gateway = true
ingress_application_gateway_name = "${random_id.prefix.hex}-agw"
enable_ingress_application_gateway = true
ingress_application_gateway_name = "${random_id.prefix.hex}-agw"
ingress_application_gateway_subnet_cidr = "10.52.1.0/24"

network_policy = "azure"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ variable "cluster_log_analytics_workspace_name" {
default = null
}

variable "location" {
description = "Location of cluster, if not defined it will be read from the resource-group"
type = string
default = null
}

variable "prefix" {
description = "(Required) The prefix for the resources created in the specified Azure Resource Group"
type = string
Expand Down