infrastructure/terraform/vultr_firewall/rules.tf
2021-03-23 22:33:10 +00:00

21 lines
600 B
HCL

resource "vultr_firewall_rule" "v4" {
for_each = toset(var.ports)
firewall_group_id = vultr_firewall_group.group.id
protocol = split("/", each.value)[1]
port = split("/", each.value)[0]
ip_type = "v4"
subnet = "0.0.0.0"
subnet_size = 0
}
resource "vultr_firewall_rule" "v6" {
for_each = toset(var.ports)
firewall_group_id = vultr_firewall_group.group.id
protocol = split("/", each.value)[1]
port = split("/", each.value)[0]
ip_type = "v6"
subnet = "::"
subnet_size = 0
}