Skip to content

Commit

Permalink
fix: use the application insights rg location when provided
Browse files Browse the repository at this point in the history
  • Loading branch information
assafgi committed Dec 2, 2024
1 parent e1af521 commit 99dd82b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion functions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,14 @@ data "azurerm_application_insights" "application_insights" {
resource_group_name = local.application_insights_rg_name
}

data "azurerm_resource_group" "application_insights_rg" {
name = local.application_insights_rg_name
}

resource "azurerm_application_insights" "application_insights" {
count = var.application_insights_name == "" && var.enable_application_insights ? 1 : 0
name = "${var.prefix}-${var.cluster_name}-application-insights"
location = data.azurerm_resource_group.rg.location
location = data.azurerm_resource_group.application_insights_rg.location
resource_group_name = local.application_insights_rg_name
workspace_id = local.log_analytics_workspace_id
application_type = "web"
Expand Down

0 comments on commit 99dd82b

Please sign in to comment.