Skip to content

Commit

Permalink
fix: main.tf and added variables for requred value of log-analitics
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavcloud committed Sep 16, 2024
1 parent 3067295 commit 11e3950
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/basic/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3.0"
required_version = ">= 1.6.6"
}

terraform {
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3.0"
required_version = ">= 1.6.6"
}

terraform {
Expand Down
2 changes: 1 addition & 1 deletion examples/firewall-with-isolated-rules/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3.0"
required_version = ">= 1.6.6"
}

terraform {
Expand Down
2 changes: 1 addition & 1 deletion examples/firewall-with-public-ip-prefix/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3.0"
required_version = ">= 1.6.6"
}

terraform {
Expand Down
19 changes: 9 additions & 10 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -264,24 +264,23 @@ resource "azurerm_monitor_diagnostic_setting" "firewall_diagnostic-setting" {
log_analytics_workspace_id = var.log_analytics_workspace_id

enabled_log {
category = "FirewallApplicationRule"
}
category = var.firewall_application_rule_category
}

enabled_log {
category = "FirewallNetworkRule"
}
category = var.firewall_network_rule_category
}

enabled_log {
category = "FirewallThreatIntel"
}
category = var.firewall_threat_intel_category
}

metric {
category = "AllMetrics"
enabled = true
category = var.metric_category
enabled = var.metric_enabled

retention_policy {
enabled = var.retention_policy_enabled
days = var.days
}
days = var.retention_days
}
}
43 changes: 43 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,46 @@ variable "enable_prefix_subnet" {
default = false
description = "Should subnet id be attached to first public ip name specified in public ip prefix name varible. To be true when there is no individual public ip."
}

variable "firewall_application_rule_category" {
description = "Category for Firewall Application Rule log"
type = string
default = "FirewallApplicationRule"
}

variable "firewall_network_rule_category" {
description = "Category for Firewall Network Rule log"
type = string
default = "FirewallNetworkRule"
}

variable "firewall_threat_intel_category" {
description = "Category for Firewall Threat Intelligence log"
type = string
default = "FirewallThreatIntel"
}

variable "metric_category" {
description = "Category for metrics"
type = string
default = "AllMetrics"
}

variable "metric_enabled" {
description = "Enable or disable metrics"
type = bool
default = true
}

variable "retention_policy_enabled" {
description = "Enable or disable retention policy"
type = bool
default = false
}

variable "retention_days" {
description = "Number of days to retain logs"
type = number
default = 30
}

0 comments on commit 11e3950

Please sign in to comment.