Skip to content

Commit

Permalink
Fix : Updated Github Workflows and added Latest Azurerm Version
Browse files Browse the repository at this point in the history
  • Loading branch information
vedant990 committed Jan 9, 2025
1 parent 1b5a585 commit 86449f9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ resource "azurerm_firewall" "firewall" {
threat_intel_mode = var.threat_intel_mode
sku_tier = var.sku_tier
sku_name = var.sku_name
firewall_policy_id = join("", azurerm_firewall_policy.policy.*.id)
firewall_policy_id = azurerm_firewall_policy.policy[count.index].id
tags = module.labels.tags
private_ip_ranges = var.firewall_private_ip_ranges
dns_servers = var.dns_servers
Expand All @@ -82,7 +82,7 @@ resource "azurerm_firewall" "firewall" {
# var.enable_ip_subnet will be true when individual public ip and prefix public ip both are to be deployed (none of them exist before) or only individual public ip are to be deployed.
# var.enable_ip_subnet will be false when prefix_public_ip already exists and there are no individual public ip.
subnet_id = var.enable_ip_subnet ? it.key == 0 ? var.subnet_id : null : null
public_ip_address_id = azurerm_public_ip.public_ip.*.id[it.key]
public_ip_address_id = azurerm_public_ip.public_ip[it.key].id
}
}

Expand All @@ -94,7 +94,7 @@ resource "azurerm_firewall" "firewall" {
# var.enable_prefix_subnet will only be true when prefix public ips are to be deployed during initial apply and there are no individual public ips to be created.
# Individual public ips can be deployed after initial apply and var.enable_ip_subnet variable must be false.
subnet_id = var.enable_prefix_subnet ? it.key == 0 ? var.subnet_id : null : null
public_ip_address_id = azurerm_public_ip.prefix_public_ip.*.id[it.key]
public_ip_address_id = azurerm_public_ip.prefix_public_ip[it.key].id
}
}

Expand Down Expand Up @@ -129,7 +129,9 @@ resource "azurerm_firewall_policy" "policy" {
for_each = var.identity_type != null && var.sku_policy == "Premium" && var.sku_tier == "Premium" ? [1] : []
content {
type = var.identity_type
identity_ids = var.identity_type == "UserAssigned" ? [join("", azurerm_user_assigned_identity.identity.*.id)] : null
identity_ids = var.identity_type == "UserAssigned" ? [join(",", azurerm_user_assigned_identity.identity[*].id)] : null


}
}
}
Expand All @@ -152,8 +154,9 @@ resource "azurerm_user_assigned_identity" "identity" {
resource "azurerm_firewall_policy_rule_collection_group" "app_policy_rule_collection_group" {
count = var.enabled && var.policy_rule_enabled ? 1 : 0
name = var.app_policy_collection_group
firewall_policy_id = var.firewall_policy_id == null ? join("", azurerm_firewall_policy.policy.*.id) : var.firewall_policy_id
priority = 300
firewall_policy_id = var.firewall_policy_id == null ? (length(azurerm_firewall_policy.policy) > 0 ? join(",", azurerm_firewall_policy.policy[*].id) : null) : var.firewall_policy_id

priority = 300

dynamic "application_rule_collection" {
for_each = var.application_rule_collection
Expand Down Expand Up @@ -190,7 +193,7 @@ resource "azurerm_firewall_policy_rule_collection_group" "app_policy_rule_collec
resource "azurerm_firewall_policy_rule_collection_group" "network_policy_rule_collection_group" {
count = var.enabled && var.policy_rule_enabled ? 1 : 0
name = var.net_policy_collection_group
firewall_policy_id = var.firewall_policy_id == null ? join("", azurerm_firewall_policy.policy.*.id) : var.firewall_policy_id
firewall_policy_id = var.firewall_policy_id == null ? (length(azurerm_firewall_policy.policy) > 0 ? join(",", azurerm_firewall_policy.policy[*].id) : null) : var.firewall_policy_id
priority = 200


Expand Down

0 comments on commit 86449f9

Please sign in to comment.