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 c4c543b commit 3237641
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 7 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ resource "azurerm_firewall_policy_rule_collection_group" "network_policy_rule_co
resource "azurerm_firewall_policy_rule_collection_group" "nat_policy_rule_collection_group" {
count = var.enabled && var.dnat-destination_ip && var.policy_rule_enabled ? 1 : 0
name = var.nat_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 = 100

dynamic "nat_rule_collection" {
Expand Down
56 changes: 50 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ variable "enabled" {
variable "resource_group_name" {
description = "A container that holds related resources for an Azure solution"
default = ""
type = string
}

variable "tags" {

Check warning on line 45 in variables.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

variable "tags" is declared but not used
Expand All @@ -52,11 +53,13 @@ variable "tags" {
variable "public_ip_allocation_method" {
description = "Defines the allocation method for this IP address. Possible values are Static or Dynamic"
default = "Static"
type = string
}

variable "public_ip_sku" {
description = "The SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Basic"
default = "Standard"
type = string
}

#firewall
Expand Down Expand Up @@ -126,18 +129,59 @@ variable "additional_public_ips" {
}

variable "application_rule_collection" {
default = {}
description = "One or more application_rule_collection blocks as defined below.."
description = "Application rule collections for the firewall policy"
type = list(object({
name = string
priority = number
action = string
rules = list(object({
name = string
source_addresses = list(string)
source_ip_groups = list(string)
destination_fqdns = list(string)
protocols = list(object({
port = number
type = string
}))
}))
}))
}

variable "network_rule_collection" {
default = {}
description = "One or more network_rule_collection blocks as defined below."
description = "Network rule collections for the firewall policy"
type = list(object({
name = string
priority = number
action = string
rules = list(object({
name = string
protocols = list(string) # List of protocol types (e.g., TCP, UDP)
destination_ports = list(string) # List of destination ports
source_addresses = list(string) # Optional list of source addresses
source_ip_groups = list(string) # Optional list of source IP groups
destination_addresses = list(string) # Optional list of destination addresses
destination_ip_groups = list(string) # Optional list of destination IP groups
destination_fqdns = list(string) # Optional list of destination FQDNs
}))
}))
}


variable "nat_rule_collection" {
default = {}
description = "One or more nat_rule_collection blocks as defined below."
description = "NAT rule collections for the firewall policy"
type = list(object({
name = string
priority = number
rules = list(object({
name = string
protocols = list(string) # List of protocols (e.g., TCP, UDP)
destination_ports = list(string) # List of destination ports
source_addresses = list(string) # Optional list of source addresses
destination_address = string # Optional destination address
translated_address = list(string) # List of translated addresses
translated_port = string # Translated port
}))
}))
}

variable "public_ip_names" {
Expand Down

0 comments on commit 3237641

Please sign in to comment.