Terraform-IaC/template/hetzner-infra/modules/firewall/firewall.tf

22 lines
504 B
Terraform
Raw Permalink Normal View History

2023-07-09 17:05:29 +01:00
resource "hcloud_firewall" "firewall" {
name = var.firewall_name
labels = merge(
var.firewall_labels,
{
"Resource_Type" = "Firewall"
"Service_Type" = var.firewall_service_type
}
)
dynamic "rule" {
for_each = local.rule_set
content {
description = rule.value["description"]
direction = rule.value["direction"]
port = rule.value["port"]
protocol = rule.value["protocol"]
source_ips = rule.value["source_ips"]
}
}
}