Skip to content

Commit

Permalink
Merge pull request #99 from SazniMohamed/main-aug-19
Browse files Browse the repository at this point in the history
Update Log Analytics Workspace module to create log analytics solution optionally
  • Loading branch information
SazniMohamed authored Sep 4, 2024
2 parents 0ebebc2 + e91b430 commit 9db4869
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ resource "azurerm_log_analytics_workspace" "log_analytics_workspace" {
}

resource "azurerm_log_analytics_solution" "log_analytics_solution" {
solution_name = "ContainerInsights"
count = var.log_analytics_solution_enabled ? 1 : 0
solution_name = var.log_analytics_solution_name
location = var.location
resource_group_name = var.resource_group_name
workspace_resource_id = azurerm_log_analytics_workspace.log_analytics_workspace.id
Expand Down
12 changes: 12 additions & 0 deletions modules/azurerm/Log-Analytics-Workspace/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,15 @@ variable "log_analytics_abbreviation" {
type = string
default = "log"
}

variable "log_analytics_solution_enabled" {
description = "Should the Log Analytics Solution be enabled?"
type = bool
default = false
}

variable "log_analytics_solution_name" {
description = "The name of the Log Analytics Solution."
type = string
default = "ContainerInsights"
}

0 comments on commit 9db4869

Please sign in to comment.