home-iac/terraform/unifi/firewall.tf
2026-05-24 02:51:15 -04:00

45 lines
1 KiB
HCL

resource "unifi_firewall_rule" "block_iot_to_trusted" {
name = "Isolate IOT"
ruleset = "LAN_IN"
action = "drop"
protocol = "all"
src_network_id = unifi_network.iot.id
src_network_type = "NETv4"
dst_network_id = unifi_network.trusted.id
dst_network_type = "NETv4"
state_new = true
state_established = false
state_invalid = true
state_related = false
}
resource "unifi_firewall_rule" "allow_trusted_to_iot" {
name = "Allow Trusted to IOT"
ruleset = "LAN_IN"
action = "accept"
protocl = "all"
src_network_id = unifi_network.trusted.id
src_network_type = "NETv4"
dst_network_id = unifi_network.iot.id
dst_network_type = "NETv4"
}
resource "unifi_firewall_rule" "block_iot_to_trusted" {
name = "Isolate IOT"
ruleset = "LAN_IN"
action = "drop"
protocol = "all"
src_network_id = unifi_network.iot.id
src_network_type = "NETv4"
dst_network_id = unifi_network.trusted.id
dst_network_type = "NETv4"
state_new = true
state_established = false
state_invalid = true
state_related = false
}